|
UnicodeString 이 필요한 곳에 char* 를 사용했네요.
산적.김현우 님이 쓰신 글 :
: 안녕하세요. UDP 와 관련된 프로그램인데
: 올바르게 질문을 하는 것인지 잘 모르겠습니다. ㅠ
:
: 사정상 C Builder 6 에서 C Builder 2010 으로 바꾸고 있는데 ,
: 아래와 같은 문제가 생겼습니다.
:
: typedef struct{
: long lRemotePort;
: long lLocalPort ;
: AnsiString aRemoteHost;
: AnsiString aLocalHost ;
: }AUDPSocketInfo;
:
:
: 위와 같이 헤더에 선언이 되어있구요..
: CPP에는 아래와 같이 되어 있습니다.
: void __fastcall TFormComm::BtnSendMsgClick(TObject *Sender)
: {
: SendCmd ( AnsiString(MSendList->Lines->Strings[0]).c_str(), MSendList->Lines->Strings[0].Length());
: }
:
: void __fastcall TFormComm::SendCmd( char *cmdStr, int iStrLen ){
: UdpSocket1->RemoteHost = aUDPSocketInfo.aRemoteHost;
: UdpSocket1->LocalHost = aUDPSocketInfo.aLocalHost ;
: UdpSocket1->RemotePort = aUDPSocketInfo.lRemotePort;
: UdpSocket1->LocalPort = aUDPSocketInfo.lRemotePort;
:
: IdUDPClient1->Host = aUDPSocketInfo.aLocalHost;
: IdUDPClient1->Port = aUDPSocketInfo.lLocalPort;
:
: IdUDPServer1->Bindings->Items[0]->IP = aUDPSocketInfo.aRemoteHost;
: IdUDPServer1->Bindings->Items[0]->Port = aUDPSocketInfo.lRemotePort;
:
: if( !IdUDPServer1->Active ) IdUDPServer1->Active = true;
: if( !IdUDPClient1->Active ) IdUDPClient1->Active = true;
:
:
: try{
: IdUDPServer1->SendBuffer(aUDPSocketInfo.aRemoteHost, aUDPSocketInfo.lRemotePort, cmdStr,iStrLen);
: }catch( EIdException *e ){
:
:
: FormMessage->RegisterMsgStr(e->Message, 11 );
: PostMessage( FormMessage->Handle, WMU_SHOWMSGDLG, 0, 0 );
: }}
:
: 그런데 문제는 Error 메시지가
:
: [BCC32 Error] UCommSetup.cpp(78): E2285 Could not find a match for 'TIdUDPBase::SendBuffer(UnicodeString,unsigned short,char *,int)'
:
: 이렇게 떳구요..
: IdUDPBase.hpp 에서
: SendBuffer 를 찾아 보니까
:
: virtual void __fastcall SendBuffer(const System::UnicodeString AHost, const System::Word APort, const Idglobal::TIdIPVersion AIPVersion, const Sysutils::TBytes ABuffer)/* overload */;
:
: 이렇게 되어 있습니다. 각각 메치가 안된 다는 것 같은데요. 선언부에서 형식을 바꾸면서 해보고 있는데,,
: 잘 안되서요. 도와주세요 ㅠㅠ;; 형식을 어떻게 바꾸여야 하지요 ㅜㅠ
:
: 원래 C Builder 6 에서는
:
: void __fastcall SendBuffer(AnsiString AHost, const int APort, void *ABuffer, const int AByteCount); 이런 형식이였습니다.
|