C++Builder Programming Forum
C++Builder  |  Delphi  |  FireMonkey  |  C/C++  |  Free Pascal  |  Firebird
볼랜드포럼 BorlandForum
 경고! 게시물 작성자의 사전 허락없는 메일주소 추출행위 절대 금지 |
아이디 비밀번호
 
C++빌더 포럼
Q & A
FAQ
팁&트릭
강좌/문서
자료실
컴포넌트/라이브러리
메신저 프로젝트
볼랜드포럼 홈
헤드라인 뉴스
IT 뉴스
공지사항
자유게시판
해피 브레이크
공동 프로젝트
구인/구직
회원 장터
건의사항
운영진 게시판
회원 메뉴
북마크
볼랜드포럼 광고 모집

C++빌더 Q&A
C++Builder Programming Q&A
[46017] Re:Re:Re:Re:Cannot delete file after using on IMessage::AddAttachment..
alex [] 1232 읽음    2006-08-04 10:55
Thanks for your tip.

m_pIMessage is global i can not set to null :(
I work around to solve this issue anyway . Using AddBody..

For your curiosity..
I'm Korean but work in NewZealand now.
I always get lots of help from your forum.. Thanks


박지훈.임프 님이 쓰신 글 :
: I didn't try, and don't know if this would be a solution.
: Just an idea.
:
: pIBodyPart->Release();
: pIBodyPart = NULL;
: m_pIMessage->Release();
: m_pIMessage = NULL;
:
: p.s.
: Where are you from, alex?
: We Korean C++Builder developers welcome you, regardless of your country. :)
:
:
: alex 님이 쓰신 글 :
: : Actullay, the file is created on temp folder.
: : But i still cannot delete.
: :
: : Thanks
: :
: :
: : nicekr.황경록 님이 쓰신 글 :
: : : i don't know about CDO and M$ Exchange Server & Client application.
: : : if problem is file locking that use AddAttachment, how about use temporary file name?
: : : generate the temporary file name every time, it is a one of solution that i think.
: : :
: : : alex 님이 쓰신 글 :
: : : : The file("c:\\filename.txt" ) i used for attachment cannot delete until the application terminated..
: : : :
: : : : Is there anyway i can delete it?  Is it suppose to work this way???
: : : : Thanks in advance..
: : : :
: : : :
: : : :     CDO::IBodyPart* pIBodyPart = NULL;
: : : :     if ( SUCCEEDED(  m_pIMessage->AddAttachment( L"c:\\filename.txt",L"",L"",&pIBodyPart )
: : : :     {
: : : :                 hr = pIBodyPart->put_ContentMediaType( _bstr_t( "text/plain" ) );
: : : :                 std::string  strDisposition ="attachment;filename=" ;
: : : :                 strDisposition += SZ_FILTERFILE ;
: : : :                 {
: : : :                     Field*  pField = NULL;
: : : :                     Fields* pFields = NULL;
: : : :                     hr = pIBodyPart->get_Fields( &pFields );
: : : :                     // Disposition.
: : : :                     hr = pFields->get_Item( _variant_t( "urn:schemas:mailheader:content-disposition" ), &pField );
: : : :                     _bstr_t bstrDisposition( strDisposition.c_str() );
: : : :                     hr = pField->put_Value( _variant_t( bstrDisposition ) );
: : : :                     pField->Release();
: : : :                     pField= NULL;
: : : :                     hr = pFields->Update();
: : : :                     pFields->Release();
: : : :                   
: : : :                 }
: : : : }

+ -

관련 글 리스트
45977 Cannot delete file after using on IMessage::AddAttachment.. alex 1068 2006/08/02
45984     Re:Cannot delete file after using on IMessage::AddAttachment.. nicekr.황경록 1016 2006/08/02
45995         Re:Re:Cannot delete file after using on IMessage::AddAttachment.. alex 885 2006/08/03
46014             Re:Re:Re:Cannot delete file after using on IMessage::AddAttachment.. 박지훈.임프 961 2006/08/04
46017                 Re:Re:Re:Re:Cannot delete file after using on IMessage::AddAttachment.. alex 1232 2006/08/04
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.