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