Æ
月夕
How to convert CString to LPCWSTR
In my code, the function need a parameter LPCWSTR
And I find this can work
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
CFileFind finder;
BOOL bWorking = finder.FindFile(_T("C:\\*.bmp"));
bWorking = finder.FindNextFile();
SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, (LPTSTR)(LPCTSTR)
finder.GetFilePath(), 0);
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
why we have to add this two (LPTSTR)(LPCTSTR) casting symbols,why
this
works
and is there any ways more usual.
I was confused by the numerous types in MFC, such as unicode, ANISI,
MultibyteChar and so on
thanks in advance
In my code, the function need a parameter LPCWSTR
And I find this can work
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
CFileFind finder;
BOOL bWorking = finder.FindFile(_T("C:\\*.bmp"));
bWorking = finder.FindNextFile();
SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, (LPTSTR)(LPCTSTR)
finder.GetFilePath(), 0);
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
why we have to add this two (LPTSTR)(LPCTSTR) casting symbols,why
this
works
and is there any ways more usual.
I was confused by the numerous types in MFC, such as unicode, ANISI,
MultibyteChar and so on
thanks in advance