OL logon programatically (by VC++)

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi.

Quest #1
Is this the correct place for my question? If no, let me know where I have
to post it, please.

Quest #2
Scenario: OL2K with Exchange2003. My application have to read folders tree
and have to import mails. I use MAPI (msoutl9.tlh).
Condition 1: I'm already logged on exchange server by OL (File | Work online).
Condition 2: I'm not already logged on exchange server.

My App in condition 1 works good.
In condition 2, logon works (see below) , but when I try to navigate
exchange folders I have a login error.

My logon istruction is

_NameSpacePtr m_folders = m_app->GetNamespace(_T("MAPI"));
hr = m_folders->Logon(covOptional, covOptional, covTrue, covOptional);

where

_variant_t covOptional((long)DISP_E_PARAMNOTFOUND, VT_ERROR);
_variant_t covTrue(true);

Unfortunately, no login dialog appears.

Any suggest?
How I do to obtain login dialog runs by my app?

Alessandro
 
=?Utf-8?B?YmJ1aW8=?= said:
Is this the correct place for my question? If no, let me know where I
have to post it, please.

This is probably as good a place as any; you could also try
microsoft.public.win32.programmer.messsaging.
Scenario: OL2K with Exchange2003. My application have to read folders
tree and have to import mails. I use MAPI (msoutl9.tlh).
Condition 1: I'm already logged on exchange server by OL (File | Work
online). Condition 2: I'm not already logged on exchange server.

My App in condition 1 works good.
In condition 2, logon works (see below) , but when I try to navigate
exchange folders I have a login error.

It's possible that Outlook is not actually logging on when you tell it to
and only 'really' does the logon when you try and do something with the
session -- CDO1.21 has the same sort of issue.

Outlook can only have one session at a time, even across multiple
instances, so I would guess that what's happening when your Outlook app is
offline, it's getting confused and doesn't want to log in properly.

When you say "not logged on exchange server", what exactly do you mean?
You could try code like that at
http://www.cdolive.com/cdo5.htm#MAPISessionMode
to see if that tells you anything more useful about what's going on.

-- dan
 
Hi dan.. tnx for your help..

When i say "not logged on exchange server" i mean that if i execute my
application not having previously connected to Exchange via Outlook (in
Outlook: File -> Work online) I have no chance to see the exchange login
dialog.

I guess suggested code is my goal.. but unfortunately in my MAPI
(msoutl9.tlh) there isnt InfoStore and so I dont know how I can access to
"H6632000B".

bbuio
 
=?Utf-8?B?YmJ1aW8=?= said:
When i say "not logged on exchange server" i mean that if i execute my
application not having previously connected to Exchange via Outlook
(in Outlook: File -> Work online) I have no chance to see the exchange
login dialog.

Okay, so that does sound like a problem with Outlook; I don't know enough
about the OOM to be sure if there is a way to get around it.
I guess suggested code is my goal.. but unfortunately in my MAPI
(msoutl9.tlh) there isnt InfoStore and so I dont know how I can access
to "H6632000B".

That's CDO1.21 code, you need to make sure 'collaboration data objects'
is installed as a component of Outlook (from add/remove programs), and you
can then #import cdo.dll (or use DevStudio's class generation stuff if you
prefer that). After that, it's just the usual things for converting VB
code to C++.

-- dan
 
Back
Top