Page 1 of 1

namespace problem

Posted: Fri 18 Apr 2008 13:46
by ib
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) )

Posted: Mon 21 Apr 2008 09:36
by Dimon
Thank you for information. We have reproduced this problem and fixed it. This fix will be included in the next SecureBridge build.
As a temporary solution, you should open the SecureBridge_InstDir\Include\ScCertificateIntf.hpp file,
find the following line:

Code: Select all

typedef unsigned LONG;
and delete it.
SecureBridge_InstDir is the SecureBridge installation directory on your computer.

Posted: Mon 21 Apr 2008 13:40
by ib
Thank you.
The compiler is now satisfied 8)