The Message text: |
Hi!,
This email was created by [MemberName] <[MemberEmail]> who thought you would be interested in the following Article:
"Converting TCHAR[] to string, while getting PC Name" You might have considered using ::GetComputerNameA() which does the conversion for you:std::string GetSystemName(){ CHAR sBuf[MAX_COMPUTERNAME_LENGTH + 1] = {0}; DWORD dwLen = MAX_COMPUTERNAME_LENGTH; ::GetComputerNameA(sBuf, &dwLen); return std::string(sBuf);}Note...
CodeProject also contains hundreds of articles, free source code samples and applications to help in your day to day programming. Why not give it a try! |