_WIN32_WINNT &WinBase.h 
Author Message
 _WIN32_WINNT &WinBase.h

Hi,

I've defined _WIN32_WINNT 0x0500.
But I got the message
f:\test\test.cpp(28): error
C2065: 'COMPUTER_NAME_FORMAT' : undeclared identifier

if(!GetComputerNameEx((COMPUTER_NAME_FORMAT)
ComputerNameDnsHostname,pBuf,&dwSize))

I've included <WinBase.h>

Has anyone else ran into something like this?

Thanks a lot

Dupont



Tue, 29 Nov 2005 13:33:06 GMT  
 _WIN32_WINNT &WinBase.h

Quote:
>I've defined _WIN32_WINNT 0x0500.
>But I got the message
>f:\test\test.cpp(28): error
>C2065: 'COMPUTER_NAME_FORMAT' : undeclared identifier

>if(!GetComputerNameEx((COMPUTER_NAME_FORMAT)
>ComputerNameDnsHostname,pBuf,&dwSize))

>I've included <WinBase.h>

>Has anyone else ran into something like this?

The type cast should be unnecessary, and you should #include windows.h
rather than winbase.h (the SDK docs now seem to mention this latter
point - at last). Have you defined _WIN32_WINNT=0x0500 soon enough -
such as in your project settings?

#include <windows.h>

if( !GetComputerNameEx( ComputerNameDnsHostname,pBuf,&dwSize))

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq



Tue, 29 Nov 2005 15:27:27 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. #include <winbase.h> gives me syntax errors in winbase.h

2. Question about "winbase.h" header file

3. Error whenever I include <winbase.h>

4. winbase.h and GetLastError()

5. Sleep in winbase.h?

6. Function does not exist in winbase.h

7. Winbase.h and compilation errors

8. Missing Storage class error in winbase.h

9. C2061 in winbase.h

10. Bad winbase.h file

11. Error whenever I include winbase.h

12. Compiler complaining about WINBASE.H

 

 
Powered by phpBB® Forum Software