TCHAR nameBuf[]
に変換したいstring
。
TCHAR nameBuf[MAX_COMPUTERNAME_LENGTH + 2];
DWORD nameBufSize;
nameBufSize = sizeof nameBuf - 1;
GetComputerName(nameBuf, &nameBufSize); //store computer name into nameBuf
_tprintf(_T("%s"), nameBuf); //print the computer name