|
질문 올리고 나서 생각좀 해보고 있는데요...그래도 해결 못해서 다시 질문 올립니다.
TIdAttachment클래스의 생성자가 어떻게 선언돼있는지 찾아보니까
__fastcall TIdAttachment(TIdMessageParts* Collection, const AnsiString AFileName);
이게 생성자 같은데...
헌데 소스상에서
AnsiString astrFileName;
astrFileName = "temp";
TIdAttachment *IdAttachment = new TIdAttachment(IdMessage1->MessageParts->Items[i],astrFileName);
이렇게 작성을 하고 컴파일 하면 아래와 같은 에러가 발생합니다.
[C++ Error] MailMain.cpp(149): E2285 Could not find a match for 'TIdAttachment::TIdAttachment(TIdMessagePart *,AnsiString)'
빌더사용한지도 별로 안되고 씨++도 익숙하지가 못해서 도저히 해결 방법을 모르겠네요...
윤구 님이 쓰신 글 :
:
: ListBox1.Items.Add( TIdAttachment( IdMsg.MessageParts.Items[i] ).FileName ) ,
:
: TStringList( TIdText( IdMsg.MessageParts.Items[i] ).Body ).SaveToFile(ExtractFilePath(Application.ExeName) + 'tempmail.htm');
:
:
: 위에 있는 두개가 델파이에서 있는 소스인데요 저걸 빌더에서 어떤식으로 해주어야 할지 잘 모르겠습니다.
: 약간만 바꾸어서 TStringList( TIdText( IdMessage1.MessageParts.Items[i])->Body ).SaveToFile(ExtractFilePath(Application->ExeName) + "tempmail.htm");
: 이렇게 하면 [C++ Error] MailMain.cpp(154): E2459 VCL style classes must be constructed using operator new 이런 에러가 발생합니다.
:
: 그래서 변수로 선언해서 사용하려고 아래처럼 바꿔서 해보면
:
: TIdText *IdText(IdMessage1->MessageParts->Items[i]);
:
: [C++ Error] MailMain.cpp(149): E2031 Cannot cast from 'TIdMessagePart *' to 'TIdText'
: [C++ Error] MailMain.cpp(149): E2285 Could not find a match for 'TIdText::TIdText(TIdMessagePart *)'
: 두개의 에러가 발생합니다....
: 제 생각에는 IdText클래스에 저런 생성자가 없어서 나는 에러 같은데...그럼 인자 없이 만들고
: TIdText *IdText;
: IdText가 가지는 어떤 값에다가 IdMessage1->MessageParts->Items[i]이걸 넣어주면 될거 같은데
: 도움말을 봐도 어떻게 해야 하는지 모르겠습니다.
:
: TIdAttachment에서도 비슷한 이유로 에러가 나서 해결을 못하고 있습니다.
: TIdText,TIdAttachment 이 두개를 어떻게 사용을 해야 하는지 알려주세요.
:
:
|