Click here to Skip to main content
11,573,666 members (55,193 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as

Converting TCHAR[] to string, while getting PC Name

, 8 Jun 2010 CPOL 3.9K 1
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...



Compare Revision Minor Date Status Editor
1 - publicly available No 9-Jun-10 5:18 Available Alain Rist


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


About the Author

Alain Rist
France France
No Biography provided

You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.150624.2 | Last Updated 9 Jun 2010
Article Copyright 2010 by Alain Rist
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid