How Will LPWSTR convert LPSTR ??

Category: VC/MFC -> Foundation Classes Author: y312150291 Date: 2013-01-31 00:39:44
 
y312150291
2013-01-31 00:39:44
LPWSTR TitleName;
::GetWindowText(hWnd,TitleName,NULL);
MessageBox(NULL,TitleName/*MessageBox LPSTR*/,0,0);
Under

how this case should turn ?
f1x2x3b4
2013-01-31 01:03:13
TCHAR   TitleName [100];

:: GetWindowText (hWnd, TitleName, NULL);
MessageBox (NULL, TitleName / * MessageBox need is a LPSTR * /, 0,0);
wodplmmree
2013-01-31 01:38:13
TCHAR   TitleName [100];
:: GetWindowText (hWnd, TitleName, 100);
MessageBox (NULL, TitleName / * MessageBox need is a LPSTR * /, 0,0);
bxcbxcbxc
2013-01-31 02:04:43


LPSTR is char *   Oh ,
should be   char   TitleName [100] = {0};

if to automatically adapt to the   ASCII and UNICODE   may use   TCHAR