Changeset 747 in dev for trunk/ab5.0/jenga/src
- Timestamp:
- Sep 15, 2008, 4:41:01 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ab5.0/jenga/src/common/String.cpp
r745 r747 33 33 } 34 34 35 std::string Jenga::Common::ToString( const std::wstring &wstr ) 36 { 37 char *pstr = (char *)malloc( wstr.length() + 1 ); 38 39 WideCharToMultiByte( 40 CP_ACP, 41 0, 42 wstr.c_str(), -1, 43 pstr, static_cast<int>(wstr.length()) + 1, 44 NULL, NULL ); 45 46 std::string result = pstr; 47 48 free( pstr ); 49 50 return result; 51 } 52 35 53 std::wstring Jenga::Common::ToWString( const std::string &str ) 36 54 { … … 41 59 NULL, 0 ) * 4; 42 60 43 LPWSTR pwstr = (LPWSTR) malloc( size);61 LPWSTR pwstr = (LPWSTR)calloc( size, 1 ); 44 62 45 63 MultiByteToWideChar(
Note:
See TracChangeset
for help on using the changeset viewer.