If Your Computer has no name, or the name is longer as MAX_COMPUTERNAME_LENGTH characters, or contains characters that are outside the standard character set, You can has this Problem.
I use the Code:
char cname[MAX_COMPUTERNAME_LENGTH+1];
int lengu = MAX_COMPUTERNAME_LENGTH+1;
if(!GetComputerName( cname, &lengu)) {
bSuccess_c = FALSE;
}
an it works (NT 4.0, Windows 95/98).