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
[45977] Cannot delete file after using on IMessage::AddAttachment..
alex [] 1071 읽음    2006-08-02 14:35
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 1071 2006/08/02
45984     Re:Cannot delete file after using on IMessage::AddAttachment.. nicekr.황경록 1019 2006/08/02
45995         Re:Re:Cannot delete file after using on IMessage::AddAttachment.. alex 889 2006/08/03
46014             Re:Re:Re:Cannot delete file after using on IMessage::AddAttachment.. 박지훈.임프 965 2006/08/04
46017                 Re:Re:Re:Re:Cannot delete file after using on IMessage::AddAttachment.. alex 1240 2006/08/04
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.