Post by RayneI have
status = GetComputerNameEx(ComputerNameDnsHostname, buf, &dwSize);
and I get the errors
error C2065: 'ComputerNameDnsHostname': undeclared identifier
error C3861: 'GetComputerNameEx': identifier not found, even with
argument-dependent lookup
I have #include <windows.h>, and using GetComputerName(buf, &dwSize);
does not give me any errors.
I haven't checked, but here's what I would do:
Look up the docs at msdn.microsoft.com. There, near the bottom, you will see
which OS version is required, which header file to include and which
library to link.
I guess the header and library are nothing new to you, but the OS version
probably is. This OS version must be defined using the _WIN32_WINNT macro
and similar ones. This must happen _BEFORE_ including the headers, best
define it consistently for all source files. It causes your program not to
run on earlier versions of the OS, since that version doesn't support the
API.
Uli
--
C++ FAQ: http://parashift.com/c++-faq-lite
Sator Laser GmbH
Geschäftsführer: Thorsten Föcking, Amtsgericht Hamburg HR B62 932