L
Lars Iversen
Hi.
I take part in developing an exchange client extension for Outlook
based on extended MAPI. The application extends Outlook with commands,
a new message class and a form, uses advise sinks to listen to folders
for events, adds and removes message stores from the profile, etc. I
use VS2005 on different platforms.
Inside my implementation of IExchExt::Install, the extension accesses
the (outlook) profile, and adds and removes message stores as described
in http://support.microsoft.com/?kbid=171636. No problem, works fine.
However, when I try to access the profile in much the same way (just
for reading purposes) from my implementation of
IPersistMessage::InitNew, it fails. More specifically,
IMsgServiceAdmin::AdminProviders returns 0x80010104 (RPC could not call
the server or could not return the result of calling the server). I
have included pseudo code below. Any clue of what is going wrong?
Regards,
Lars
STDMETHODIMP MyForm::InitNew(IMAPIMessageSite* site, IMessage*)
{
CComPtr<IMAPISession> session;
site->GetSession(&session.p);
CComPtr<IMsgServiceAdmin> messageServiceAdministration;
session->AdminServices(0, &messageServiceAdministration.p);
CComPtr<IMAPITable> table;
messageServiceAdministration.GetMessageServiceTable(0, &table.p);
MAPIUID uid = ...; // the uid in the table with PR_SERVICE_NAME =
'MSEMS'
CComPtr<IProviderAdmin> providerAdmin;
HRESULT hr = messageServiceAdministration->AdminProviders(&uid, 0,
&providerAdmin.p); // hr has the value 0x80010104
I take part in developing an exchange client extension for Outlook
based on extended MAPI. The application extends Outlook with commands,
a new message class and a form, uses advise sinks to listen to folders
for events, adds and removes message stores from the profile, etc. I
use VS2005 on different platforms.
Inside my implementation of IExchExt::Install, the extension accesses
the (outlook) profile, and adds and removes message stores as described
in http://support.microsoft.com/?kbid=171636. No problem, works fine.
However, when I try to access the profile in much the same way (just
for reading purposes) from my implementation of
IPersistMessage::InitNew, it fails. More specifically,
IMsgServiceAdmin::AdminProviders returns 0x80010104 (RPC could not call
the server or could not return the result of calling the server). I
have included pseudo code below. Any clue of what is going wrong?
Regards,
Lars
STDMETHODIMP MyForm::InitNew(IMAPIMessageSite* site, IMessage*)
{
CComPtr<IMAPISession> session;
site->GetSession(&session.p);
CComPtr<IMsgServiceAdmin> messageServiceAdministration;
session->AdminServices(0, &messageServiceAdministration.p);
CComPtr<IMAPITable> table;
messageServiceAdministration.GetMessageServiceTable(0, &table.p);
MAPIUID uid = ...; // the uid in the table with PR_SERVICE_NAME =
'MSEMS'
CComPtr<IProviderAdmin> providerAdmin;
HRESULT hr = messageServiceAdministration->AdminProviders(&uid, 0,
&providerAdmin.p); // hr has the value 0x80010104