Click here to Skip to main content
13,052,696 members (64,449 online)
Click here to Skip to main content

Tagged as

Stats

5.9K views
1 bookmarked
Posted 8 Jun 2010

Converting TCHAR[] to string, while getting PC Name

, 8 Jun 2010
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...

Views

Downloads

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Alain Rist
France France
No Biography provided

You may also be interested in...

Pro
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.170713.1 | Last Updated 9 Jun 2010
Article Copyright 2010 by Alain Rist
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid