Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming Add-Ins / September 2003

Tip: Looking for answers? Try searching our database.

Scope of CDO:AddressBook method (C++/ATL)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Paul Keogh - 19 Sep 2003 16:27 GMT
Hi,

I'm writing an add-in in ATL/C++. I've successfully created a CDO:Session
CoClass instance in the OnConnection method and successfully invoked the
GetVersion () method.

However, when I invoke the AddressBook () with no arguments it does'nt
display and the method returns immediately.

Whats the scope of the AddressBook () method ?

Do I need to logon to the CDO session first ?

Hanx!,
Paul.
Dmitry Streblechenko - 19 Sep 2003 18:05 GMT
How do you call the method and what does it return?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy  - Outlook, CDO
and MAPI Developer Tool

> Hi,
>
[quoted text clipped - 11 lines]
> Hanx!,
> Paul.
Paul Keogh - 23 Sep 2003 15:31 GMT
> How do you call the method and what does it return?

I was calling it as m_spSession -> AddressBook ().

Seems I need to call m_spSession -> Logon () first.
I added this and it works fine now.

Any suggestions on how to access the recipients collection object returned
from ATL ?
I've looked at the MFC CDO sample that wraps COleDispatchDisp but I want to
work
in ATL.

Would implementing the interface from olemsg32.dll work ?
Dmitry Streblechenko - 23 Sep 2003 18:23 GMT
Session.AddressBook returns Recipients object. Since you already have the
wrapper classes for the CDO objects, shouldn't be a problem to use this one
as well, even though I have no idea how (AttachDispatch()?), I don't use
C++.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy  - Outlook, CDO
and MAPI Developer Tool

> > How do you call the method and what does it return?
>
[quoted text clipped - 10 lines]
>
> Would implementing the interface from olemsg32.dll work ?
Paul Keogh - 24 Sep 2003 14:07 GMT
> Session.AddressBook returns Recipients object. Since you already have the
> wrapper classes for the CDO objects, shouldn't be a problem to use this one
> as well, even though I have no idea how (AttachDispatch()?), I don't use
> C++.

I have wrapper classes in MFC, not ATL which is what I have to use.

The whole purpose of using CDO is to get at the AddressBook GUI from within
my add-in. Its not available from the Outlook Object Model as far as I can
tell,
so its either CDO or extended MAPI that I have to use. BTW, the CDO
session Logon() method now throws an exception !.

<rant>
C++ is hardest way to do this stuff for sure. I find the docs and samples
from Microsoft
to be poor to the point of unusable. If  I was'nt being paid for this,
there's no way I'd
touch these technologies.
</rant
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.