diff options
author | Tino Rachui <tra@openoffice.org> | 2001-10-15 09:50:05 +0000 |
---|---|---|
committer | Tino Rachui <tra@openoffice.org> | 2001-10-15 09:50:05 +0000 |
commit | 426e0d498f3d60f5784702227967e22b211922ed (patch) | |
tree | 9537785ce39558743eea335cd934128b7d76f099 /shell/source | |
parent | 557c9f3ca912833f20c24f507f42eb48b675467a (diff) |
#93077#now using an existing session and ignoring the flag NO_LOGON_DIALOG else we may run into trouble when using Outlook (not Outlook Express), see comment for file smplmailsuppl.cxx
Diffstat (limited to 'shell/source')
-rw-r--r-- | shell/source/win32/simplemail/smplmailclient.cxx | 27 | ||||
-rw-r--r-- | shell/source/win32/simplemail/smplmailclient.hxx | 8 |
2 files changed, 27 insertions, 8 deletions
diff --git a/shell/source/win32/simplemail/smplmailclient.cxx b/shell/source/win32/simplemail/smplmailclient.cxx index 16368a8dd345..afff5f4fd272 100644 --- a/shell/source/win32/simplemail/smplmailclient.cxx +++ b/shell/source/win32/simplemail/smplmailclient.cxx @@ -2,9 +2,9 @@ * * $RCSfile: smplmailclient.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: tra $ $Date: 2001-05-25 08:21:23 $ + * last change: $Author: tra $ $Date: 2001-10-15 10:50:05 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -133,9 +133,21 @@ namespace // private // //------------------------------------------------ -CSmplMailClient::CSmplMailClient( ) : +CSmplMailClient::CSmplMailClient( LHANDLE hMapiSession ) : + m_hMapiSession( hMapiSession ), m_pSimpleMapi( CSimpleMapi::create( ) ) { + OSL_ASSERT( m_hMapiSession ); +} + +//------------------------------------------------ +// +//------------------------------------------------ + +CSmplMailClient::~CSmplMailClient( ) +{ + ULONG ulRet = m_pSimpleMapi->MAPILogoff( m_hMapiSession, 0, 0, 0 ); + OSL_ASSERT( SUCCESS_SUCCESS == ulRet ); } //------------------------------------------------ @@ -166,16 +178,18 @@ void SAL_CALL CSmplMailClient::sendSimpleMailMessage( const Reference< XSimpleMa initMapiSendMailFlags( aFlag, flFlags ); ULONG ulRet = m_pSimpleMapi->MAPISendMail( - 0, // no session, create a new one + m_hMapiSession, // we use an existing session #93077# 0, // no parent window &mapiMsg, // a configured mapi message struct flFlags, // some flags 0 ); // reserved if ( SUCCESS_SUCCESS != ulRet ) + { throw Exception( getMapiErrorMsg( ulRet ), static_cast< XSimpleMailClient* >( this ) ); + } } catch( RuntimeException& ) { @@ -390,7 +404,10 @@ void CSmplMailClient::initAttachementList( void CSmplMailClient::initMapiSendMailFlags( sal_Int32 aFlags, FLAGS& aMapiFlags ) { - aMapiFlags = MAPI_NEW_SESSION | MAPI_UNICODE; + // #93077# + OSL_ASSERT( !( aFlags & NO_LOGON_DIALOG ), "Flag NO_LOGON_DIALOG has currently no effect" ); + + aMapiFlags = MAPI_UNICODE; // #93077# MAPI_NEW_SESSION if ( !( aFlags & NO_USER_INTERFACE ) ) aMapiFlags |= MAPI_DIALOG; diff --git a/shell/source/win32/simplemail/smplmailclient.hxx b/shell/source/win32/simplemail/smplmailclient.hxx index d8bac6904ef4..45d879e60f8a 100644 --- a/shell/source/win32/simplemail/smplmailclient.hxx +++ b/shell/source/win32/simplemail/smplmailclient.hxx @@ -2,9 +2,9 @@ * * $RCSfile: smplmailclient.hxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: tra $ $Date: 2001-05-14 08:08:31 $ + * last change: $Author: tra $ $Date: 2001-10-15 10:50:05 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -98,7 +98,8 @@ class CSmplMailClient : public cppu::WeakImplHelper1< com::sun::star::system::XSimpleMailClient > { public: - CSmplMailClient( ); + CSmplMailClient( LHANDLE hMapiSession ); + ~CSmplMailClient( ); //------------------------------------------------ // @@ -135,6 +136,7 @@ private: rtl::OUString getMapiErrorMsg( ULONG ulMapiError ); private: + LHANDLE m_hMapiSession; CSimpleMapi* m_pSimpleMapi; rtl::OString m_Subject; rtl::OString m_SmtpAddressOriginator; |