아 그렇군요. 정말 감사해요.
박우성 님이 쓰신 글 :
: 질문하신 분께서 지금 헤매고 있는 이유는 stProtocolFileComplete.comResultText의 자료형이 정확하게 뭔지를 모르고 계시기 때문입니다. 질문 내용에 자료형이 뭔지 정확하게 언급이 안되어 있으므로, 답변을 하신 분도 계속 같이 헤매게 되는 거죠.
:
: stProtocolFileComplete.comResultText의 자료형에 따라서, 답변이 여러개 나올 수 있으므로, 자료형부터 확인해 보시기 바라며, 제가 몇가지 경우에 대한 해결 방법을 알려드립니다.
:
: 오류 메시지만 봐서는 char*형일 가능성이 있네요.
:
:
: //AnsiString일 경우
: stProtocolFileComplete.comResultText = "파일명 : " + ExtractFileName(stProtocolFileComplete.FCname) + " , 사이즈 : " + IntToStr(stProtocolFile.FSize) + " 완료";
:
: //UnicodeString일 경우
: stProtocolFileComplete.comResultText = L"파일명 : " + ExtractFileName(stProtocolFileComplete.FCname) + L" , 사이즈 : " + IntToStr(stProtocolFile.FSize) + L" 완료";
:
: //BSTR형일 경우 (ActiveX등과 같은..)
: WideString ResultText = L"파일명 : " + ExtractFileName(stProtocolFileComplete.FCname) + L" , 사이즈 : " + IntToStr(stProtocolFile.FSize) + L" 완료";
: stProtocolFileComplete.comResultText = ResultText.c_bstr();
:
: //char *형일 경우
: AnsiString ResultText = "파일명 : " + ExtractFileName(stProtocolFileComplete.FCname) + " , 사이즈 : " + IntToStr(stProtocolFile.FSize) + " 완료";
: strcpy( stProtocolFileComplete.comResultText, ResultText.c_str() );
:
: //wchar_t형일 경우
: UnicodeString ResultText = L"파일명 : " + ExtractFileName(stProtocolFileComplete.FCname) + L" , 사이즈 : " + IntToStr(stProtocolFile.FSize) + L" 완료";
: wcscpy( stProtocolFileComplete.comResultText, ResultText.w_str() );
:
: 제가 알려드린 답이 도움이 안 될 수도 있습니다. 자료형에 대한 이해와 strcpy와 같은 기본 함수를 더 공부해 보시길 권해 드리며, 어떤 일이든 기초는 아주 중요하다고 생각합니다.
:
:
: 축구 님이 쓰신 글 :
: :
: : strcpy(stProtocolFileComplete.comResultText, "파일명 : " + ExtractFileName(stProtocolFileComplete.FCname) + " , 사이즈 : " + IntToStr(stProtocolFile.FSize) + " 완료");
: :
: :
: : 위와 같이 하니까 이런 에러가 나던데
: :
: : [BCC32 Error] Unit1.cpp(305): E2034 Cannot convert 'UnicodeString' to 'const char *'
: : [BCC32 Error] Unit1.cpp(305): E2342 Type mismatch in parameter '__src' (wanted 'const char *', got 'UnicodeString')
: :
: : 올바른 형식좀 알려주세요 ㅠㅠ
|