내가 이런 기능이 도움이 필요하십니까 : 나는 MessageBoxW()와 함께 입력 LPCWSTR 텍스트를 표시 할 때WideCharToMultiByte를 사용하여 LPCWSTR을 변환합니다.
BOOL WINAPI MyFunction(HDC hdc, LPCWSTR text, UINT cbCount){
char AnsiBuffer[255];
int written = WideCharToMultiByte(CP_ACP, 0, text, cbCount, AnsiBuffer , 0, NULL, NULL);
if(written > -1) AnsiBuffer[written] = '\0';
if(written>0){
ofstream myfile;
myfile.open ("C:\\example.txt", ios::app);
myfile.write(AnsiBuffer, sizeof(AnsiBuffer));
myfile.write("\n", 1);
myfile.close();
}
....
를 텍스트가 미세을 보여줍니다. 멀티 바이트로 변환하려고하면 반환 값이 정상적으로 보입니다 (예 : 22, 45 등). 결과는 횡설수설 문자열입니다 (ex ÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌ). 제안?
참고. http://msdn.microsoft.com/en-us/library/f1d6b0fk(VS.80).aspx – Andy