Cant compile GetComputerNameEx
-
Im having trouble getting the
GetComputerNameEx()
function to compile. I have Visual C++ 6.0 on Windows 2000 Pro with Platform SDK installed. header is included and in Options -> Directories I have added the path C:\PROGRAM\MICROSOFT SDK\INCLUDE in the first position for include files and C:\PROGRAM\MICROSOFT SDK\LIB for library files. I thought this was all you needed to do ... but I still geterror C2065: 'GetComputerNameEx' : undeclared identifier
Any ideas ? :) Thanks in advance ! / daniel -
Im having trouble getting the
GetComputerNameEx()
function to compile. I have Visual C++ 6.0 on Windows 2000 Pro with Platform SDK installed. header is included and in Options -> Directories I have added the path C:\PROGRAM\MICROSOFT SDK\INCLUDE in the first position for include files and C:\PROGRAM\MICROSOFT SDK\LIB for library files. I thought this was all you needed to do ... but I still geterror C2065: 'GetComputerNameEx' : undeclared identifier
Any ideas ? :) Thanks in advance ! / danielYou need to set the symbol _WIN32_WINNT to 0x0500 or greater, to specifically target Win2000 or XP. If you don't do this, the declarations in winbase.h are #if'd out. Of course, this also means your app cannot run on WinNT or Win9x/ME, unless you delayload the appropriate DLL and then test OS version at runtime. Steve S