IonicWind Software

Aurora Compiler => General Discussion => Topic started by: Parker on January 14, 2006, 06:16:53 PM

Title: Bug
Post by: Parker on January 14, 2006, 06:16:53 PM
Found one more:
Registry::OpenKey(unsigned int hKey, string strSubKey, opt unsigned int dwOptions=CCL_ALL_ACCESS)
{
RegOpenKeyEx(
hKey,
strSubKey,
0,
dwOptions,
m_hKey);
}

QuoteCompiling...
Registry.src
File: C:\dev\ac\Common Classes\Registry.src (155) undefined variable - dwOptions
Error(s) in compiling "C:\dev\ac\Common Classes\Registry.src"

I have a feeling it's a problem with using a constant as the optional parameter.
#define CCL_ALL_ACCESS 0xF003F
I gave it a different prefix (I think the real one is KEY_ALL_ACCESS) to avoid conflicts with the windows API headers in the future.

Edit - nevermind, the problem was that parameter wasn't in the declaration. It was added and it works fine now.
Title: Re: Bug
Post by: sapero on January 15, 2006, 03:20:12 AM
Parker, the 'opt' keyword should be used only in class/external function definition or in module-local functions

I would change 'string strSubKey' to 'string *strSubKey to avoid problems with null :)
#define CCL_ALL_ACCESS 0xF003F
extern int RegOpenKeyExA(int q,int q,int q,int q,int q);//temp

class Registry
{
declare OpenKey(unsigned int hKey, string *strSubKey, opt unsigned int dwOptions=CCL_ALL_ACCESS);
int m_hKey;
}

Registry::OpenKey(unsigned int hKey, string *strSubKey, unsigned int dwOptions) // no opt
{
RegOpenKeyExA(hKey,strSubKey,0,dwOptions,m_hKey);
}
Title: Re: Bug
Post by: Parker on January 15, 2006, 02:31:24 PM
I used "" for that, but I'll change it and look for others to allow null, thanks.