|
최낙구 님이 쓰신 글 :
: C++ Builder 2009에서
: strcpy후에 글자 SubString하면 깨짐현상이 있읍니다.
: (그림참조)
:
: 소스
:
: String sMain="12345";
: char buff[255];
: Memo2->Lines->Add(sMain);
: Memo2->Lines->Add(sMain.SubString(1,2));
: strcpy(&buff[0],sMain.t_str());
: Memo2->Lines->Add(sMain);
: Memo2->Lines->Add(sMain.SubString(1,2));
:
: 결과
:
: 12345
: 12
: 12345
: 㐳㐳
Whenever the TCHAR mapping option is set to char (the default setting), you should not use System::UnicodeString::t_str on fields or properties that do not expect the underlying data to be narrowed. Instead, you can change the behavior of System::UnicodeString::t_str by setting the TCHAR_mapping option to wchar_t. You can make this project setting on the ProjectOptionsDirectories and Conditionals dialog box, and it will ensure that t_str() returns the UnicodeString's wide data without modifying it.
Project Option의 TCHAR 의 기본형을 wchar_t로 변경하고 .. strcpy(xxxx)쪽을 조금 수정하니..
원하는 결과는 나오네요.. 기본적인 설정 문제인 듯 한데... 저도 잘 모르기는 매한가지 네요..
ㅠ.ㅠ;;;;
|