namespace problem

Discussion of open issues, suggestions and bugs regarding network security and data protection solution - SecureBridge
Post Reply
ib
Posts: 5
Joined: Wed 16 Apr 2008 16:38
Location: BE

namespace problem

Post by ib » 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) )

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Mon 21 Apr 2008 09:36

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.

ib
Posts: 5
Joined: Wed 16 Apr 2008 16:38
Location: BE

Post by ib » Mon 21 Apr 2008 13:40

Thank you.
The compiler is now satisfied 8)

Post Reply