namespace problem
Posted: Fri 18 Apr 2008 13:46
I am using in a project the ScSSHClient and the ScFileStorage components.
After I added the code below to read a reg-key , I get errors from the compiler.
-----
159 TRegistry *reg = new TRegistry;
160 reg->RootKey = HKEY_CLASSES_ROOT ;
-----
[C++ Error] scc.cpp(160): E2015 Ambiguity between 'LONG' and 'Sccertificateintf::LONG'
This function is called from the onActivate handler of the form.
When I tell to use :
reg->RootKey = ::HKEY_CLASSES_ROOT
I get :
[C++ Error] scc.cpp(160): E2272 Identifier expected
[C++ Error] scc.cpp(160): E2015 Ambiguity between 'LONG' and 'Sccertificateintf::LONG'
Or ,
reg->RootKey=Sccertificateintf::HKEY_CLASSES_ROOT
[C++ Error] scc.cpp(160): E2272 Identifier expected
[C++ Error] scc.cpp(160): E2108 Improper use of typedef 'HKEY'
[C++ Error] scc.cpp(160): E2108 Improper use of typedef 'ULONG_PTR'
[C++ Error] scc.cpp(160): E2015 Ambiguity between 'LONG' and 'Sccertificateintf::LONG'
[C++ Error] scc.cpp(160): E2379 Statement missing ;
Is there some sort of conflict between the 2 components ?
The definition of HKEY_CLASSES_ROOT comes from
winreg.h and it is defined as
#define HKEY_CLASSES_ROOT (( HKEY ) (ULONG_PTR)((LONG)0x80000000) )
After I added the code below to read a reg-key , I get errors from the compiler.
-----
159 TRegistry *reg = new TRegistry;
160 reg->RootKey = HKEY_CLASSES_ROOT ;
-----
[C++ Error] scc.cpp(160): E2015 Ambiguity between 'LONG' and 'Sccertificateintf::LONG'
This function is called from the onActivate handler of the form.
When I tell to use :
reg->RootKey = ::HKEY_CLASSES_ROOT
I get :
[C++ Error] scc.cpp(160): E2272 Identifier expected
[C++ Error] scc.cpp(160): E2015 Ambiguity between 'LONG' and 'Sccertificateintf::LONG'
Or ,
reg->RootKey=Sccertificateintf::HKEY_CLASSES_ROOT
[C++ Error] scc.cpp(160): E2272 Identifier expected
[C++ Error] scc.cpp(160): E2108 Improper use of typedef 'HKEY'
[C++ Error] scc.cpp(160): E2108 Improper use of typedef 'ULONG_PTR'
[C++ Error] scc.cpp(160): E2015 Ambiguity between 'LONG' and 'Sccertificateintf::LONG'
[C++ Error] scc.cpp(160): E2379 Statement missing ;
Is there some sort of conflict between the 2 components ?
The definition of HKEY_CLASSES_ROOT comes from
winreg.h and it is defined as
#define HKEY_CLASSES_ROOT (( HKEY ) (ULONG_PTR)((LONG)0x80000000) )