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.
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);
}
I used "" for that, but I'll change it and look for others to allow null, thanks.