Hi,

i am porting my applicaiton from vs6.0 to vs2005
i am getting problem enum ,it is not getting integral value
Could somebody help in fixing this issue,
thanks in advance

enum Keys
	{
		classesRoot = HKEY_CLASSES_ROOT,
		currentUser = HKEY_CURRENT_USER,
		localMachine = HKEY_LOCAL_MACHINE,
		currentConfig = HKEY_CURRENT_CONFIG,
		users = HKEY_USERS,
		performanceData = HKEY_PERFORMANCE_DATA,	//Windows NT/2000
		dynData = HKEY_DYN_DATA						//Windows 95/98
	};

these lines are from winreg.h

#define HKEY_CLASSES_ROOT           (( HKEY ) (ULONG_PTR)((long)0x80000000) )
#define HKEY_CURRENT_USER           (( HKEY ) (ULONG_PTR)((long)0x80000001) )
#define HKEY_LOCAL_MACHINE          (( HKEY ) (ULONG_PTR)((long)0x80000002) )
#define HKEY_USERS                  (( HKEY ) (ULONG_PTR)((long)0x80000003) )
#define HKEY_PERFORMANCE_DATA       (( HKEY ) (ULONG_PTR)((long)0x80000004) )
#define HKEY_PERFORMANCE_TEXT       (( HKEY ) (ULONG_PTR)((long)0x80000050) )
#define HKEY_PERFORMANCE_NLSTEXT    (( HKEY ) (ULONG_PTR)((long)0x80000060) )
#if(WINVER >= 0x0400)
#define HKEY_CURRENT_CONFIG         (( HKEY ) (ULONG_PTR)((long)0x80000005) )
#define HKEY_DYN_DATA               (( HKEY ) (ULONG_PTR)((long)0x80000006) )

Recommended Answers

All 2 Replies

I believe the post directly in front of yours answers your question... Did you even read the thread before you hijacked it?

From winreg.h

#define HKEY_CLASSES_ROOT                   (( HKEY ) (ULONG_PTR)((LONG)0x80000000) )
#define HKEY_CURRENT_USER                   (( HKEY ) (ULONG_PTR)((LONG)0x80000001) )
#define HKEY_LOCAL_MACHINE                  (( HKEY ) (ULONG_PTR)((LONG)0x80000002) )
#define HKEY_USERS                          (( HKEY ) (ULONG_PTR)((LONG)0x80000003) )
#define HKEY_PERFORMANCE_DATA               (( HKEY ) (ULONG_PTR)((LONG)0x80000004) )
#define HKEY_PERFORMANCE_TEXT               (( HKEY ) (ULONG_PTR)((LONG)0x80000050) )
#define HKEY_PERFORMANCE_NLSTEXT            (( HKEY ) (ULONG_PTR)((LONG)0x80000060) )
#define HKEY_CURRENT_CONFIG                 (( HKEY ) (ULONG_PTR)((LONG)0x80000005) )
#define HKEY_DYN_DATA                       (( HKEY ) (ULONG_PTR)((LONG)0x80000006) )

You can't use #defined symbols in an enum

i read the thread before but it could not help me.
the enum is refering HKEY_CLASSES_ROOT which are defined in winreg.h
and this headerfile is in location "c:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winreg.h"
as this is not my applicaton file ,even thought i change it will effect other applicatoin which it is been refered ,
however i removed #define but it did not work

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.