Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Call to AdminServices fails in DLL - MAPI_E_LOGON_FAILED

0 views
Skip to first unread message

Tom

unread,
Jun 2, 2009, 2:01:43 PM6/2/09
to
Hello,

I am trying to add my custom provider to the default profile. The ultimate
goal is to push an MSI installation to entire network and add our custom
provider to for every user.

I have this working if I add the custom provider via an EXE. But if I try
the same logic in a DLL I am not able to do so. The call that fails is below
...

LPSERVICEADMIN lpSvcAdmin = NULL;
LPPROFADMIN lpProfAdmin = NULL;

HRESULT hr = MapiAdminProfiles(0L, &lpProfAdmin);
if(SUCCEEDED(hr))
{
// Fails this call will MAPI_E_LOGON_FAILED
hr = lpProfAdmin->AdminServices(_T("DefaultProf"), _T(""), 0L, 0L,
&lpSvcAdmin);
}

Is there anyway I can get this working in a DLL? Is there anyway around
this. The DLL is an extension DLL for the installer.

I have also tried MAPILogonEx - but it does not seem to work. The install
has to be silent and Outlook cannot be running. Furthermore the user will be
prompted to login into the custom provider once Outlook is run for the first
time after installation.

Thanks,
Tom -

Dmitry Streblechenko

unread,
Jun 2, 2009, 6:36:51 PM6/2/09
to
Do you actually have a profile named "DefaultProf"?

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"Tom" <t...@gigasoftdevelopment.com> wrote in message
news:%23FqQly6...@TK2MSFTNGP04.phx.gbl...

Tom

unread,
Jun 5, 2009, 3:59:56 PM6/5/09
to
No I am getting the default profile from the registry.

I had to create a baby executable to to add our provider to the default
Outlook profile. Fro some reason I could not do it from a DLL. So I create a
console app to add the profile.


"Dmitry Streblechenko" <dmi...@dimastr.com> wrote in message
news:%23H$uNN94J...@TK2MSFTNGP03.phx.gbl...

Henry Gusakovsky

unread,
Jul 8, 2009, 6:27:20 PM7/8/09
to
1. check if you are using proper ANSI strings. Profile API does not
want UNICODE.
2. If it is run under msi installation it can run under different
credentials so it may not find registry.

Regards
Henry

0 new messages