Kimberlee Martin
Guest
|
Posted:
Thu Nov 18, 2004 12:04 am Post subject:
CDO app and Outlook won't work together |
|
|
I have created a VB6 app which connects to an inbox for a generic user
("OrderMonitor"), and processes all mail received in that box. We created a
profile to access the appropriate inbox, and the program is using that
profile. Program works great.
The problem is that this program runs on the system administrator's machine,
and he can't log in to Outlook to read HIS email when the program is
running. Every time he tries to open Outlook, he gets prompted to enter his
user name, password and domain. Even though he is entering correct values,
it says that it is unable to log him in. When the program is not running, he
gets run into Outlook without being prompted.
Any idea why this is happening, or how to fix it?
FYI: It's a VB6 application running on Windows XP. Exchange 2000 server.
Outlook 2002. CDO 1.21.
Any help would be appreciated. Thanks in advance.
Kim Martin
|
|
Dan Mitchell
Guest
|
Posted:
Thu Nov 18, 2004 3:50 am Post subject:
Re: CDO app and Outlook won't work together |
|
|
"Kimberlee Martin" <kMartin@NorthPortSoftware.com> wrote in
news:O#O1f$MzEHA.3368@TK2MSFTNGP15.phx.gbl:
| Quote: | I have created a VB6 app which connects to an inbox for a generic user
("OrderMonitor"), and processes all mail received in that box. We
created a profile to access the appropriate inbox, and the program is
using that profile. Program works great.
The problem is that this program runs on the system administrator's
machine, and he can't log in to Outlook to read HIS email when the
program is running. Every time he tries to open Outlook, he gets
prompted to enter his user name, password and domain. Even though he
is entering correct values, it says that it is unable to log him in.
|
The problem here is that your app is creating a shareable session, and
Outlook will always join a shared session if it can. There's no way to
tell CDO1.21 to create a session that other people can't join -- you
need to use MAPILogonEx() and not pass MAPI_ALLOW_OTHERS as a flag
there.
The problem is that MAPILogonEx() (extended MAPI in general) is only
usable from C++ -- one option would be to write a DLL in C++ that logs
into the session and then hands it on to your VB code; using the
MAPIOJECT property of a CDO session you can go from an ExMAPI session to
a CDO session.
Alternative 2: run your application _after_ Outlook, and set
newSession=true in the call to Logon there. That way Outlook'll start up
fine, and your app will start up, and you've told your app not to log
into any existing shared sessions so you should be okay.
-- dan |
|