Close Exchange security window

  • Thread starter Thread starter DenisSSSS
  • Start date Start date
D

DenisSSSS

Hi.
I have cached exchange profile. When I create Outlook::Application and
displays it the exchange security window appears. User has to enter exchange
login and password. However the code continues execution and I quit from
Outlook application but exchange window still displays and Outlook still in
memory. Please, see code below

Outlook::_ApplicationPtr ol_app =
Outlook::_ApplicationPtr(L"Outlook.Application");

// exchange window appears after that line
ol_app->GetNamespace(L"MAPI")->GetDefaultFolder(Outlook::olFolderInbox)->Display();

ol_app->Quit();
//the Outlook window is closed but exchange window is still displayed and
Outlook process in memory.

Is it possible to close OL in such way that exchange window would be closed
as well. And Outlook would be removed from memory?
 
Firstly, if you don not want the credentials prompt, make sure your code
runs in te hcontext of the Windows use rwho owns the primary Exchange
mailbox in the profile.
Secondly, retrieve the Namespace obejct (Application.GetNamespace)> then
call Namespace.Logon. It is a blockign call: your code will not continue
until the prompt goes away.

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
 
Thanks, Dmitry for reply.
Unfortunately GetNameSpace->Login isn't blocking call in cached Exchange.
The Logon displays exchange security prompt and execution continues.
 
Back
Top