Subj : Re: difficulty with macros in Borland C++ 5.02 To : borland.public.cpp.borlandcpp From : "trevor Arsenault" Date : Fri Sep 05 2003 02:06 pm I realize the compiler is old but I'm working on an assignment in an education institution so I don't have a choice regarding what I use. I may have misled you into believing that I am quite knowledgeable regarding Win32 programs...I am just a begginer programmer though and most of your comments are above my knowledge level. I included "basetsd.h" into the winreg.h and that cleared up the problem with the type name expected as DWORD_PTR is declared in "basetsd.h" just like you said. I'm a little unclear regarding the HKEY though as the error is Error: winreg.h(146,12):'HKEY' cannot start a parameter declaration so is that a problem with the definition of HKEY or the macro IN before it? Am I missing a path to a lib file that has the full definition of the afore mentioned usage of HKEY? I tried including winnt.h as well but with no results should I redefine HKEY and all of it's included macro's or is there a simpler solution? if it would be easier to figure out what I'm doing I can send all of the source files in a zipped packege. thanks in advance Trevor "Ed Mulroy [TeamB]" wrote in message news:3f58cc69$1@newsgroups.borland.com... > You are using a 1997 compiler. You should expect that things will have > changed over the 6 years period since your compiler was new. > > As expanded for Win32 programs using the header files on my machine, those > from C++ Builder 6. The only include I used in the program whose > preprocessing found these things was WINDEF.H. (I could have used WINDOWS.H > which includes WINDEF.H) > > From BASETSD.H > > typedef unsigned __int64 ULONG_PTR, *PULONG_PTR; > typedef ULONG_PTR DWORD_PTR, *PDWORD_PTR; > > HKEY is defined in WINNT.H by > > DECLARE_HANDLE(HKEY); > > and DECLARE_HANDLE comes about from these lines in WINNT.H but I have added > a backslash continuation character to defend against news reader word > wrapping. > > #ifdef STRICT > typedef void *HANDLE; > #define DECLARE_HANDLE(name) \ > struct name##__ { int unused; }; typedef struct name##__ *name > #else > typedef PVOID HANDLE; > #define DECLARE_HANDLE(name) typedef HANDLE name > #endif > typedef HANDLE *PHANDLE; > > . Ed > > > trevor Arsenault wrote in message > > news:3f58c67d@newsgroups.borland.com... > > I am having difficulty translating code from VC++ to Borland recieving > > various error in standard header files. > > > > DWORD_PTR ve_valueptr; line 107 > > is the line located in WINDDK\2600\INC\WXP\winreg.h > > the error message is: > > Error: winreg.h(107,26):Type name expected > > Error: winreg.h(107,26):Declaration missing ; > > As this is a standard header file in the DDK I don't want to begin editing > > it. I have included windows.h so the macros should be understood, however, > > no luck so far. DWORD is accepted but not DWORD_PTR there are multiple > other > > errors such as: > > Error: winreg.h(145,12):'HKEY' cannot start a parameter declaration > > found on the following lines > > > > WINADVAPI > > LONG > > APIENTRY > > RegCloseKey ( > > IN HKEY hKey > > ); > > > > so I assume it is just a macro not understood in the borland enviornment > but > > do not wish to redeclare all macro's again...if it really is a macro issue > > as now I'm a little unsure. > > > > I don't explicitly include winreg.h it is implicitly included in another > > header header file that I have not been able to track down. > > > > Thank you for any assistance > > Trevor Arsenault > > > > > > .