T
Ted Byers
Here is code I have in my COM class:
// _IDTExtensibility2
STDMETHOD(OnConnection)(IDispatch * Application, ext_ConnectMode
ConnectMode, IDispatch * AddInInst, SAFEARRAY * * custom)
{
appObj = (_Application*) Application;
_Application* appPTR = appObj;
_NameSpace* nsPTR;
BSTR s = SysAllocString(L"MAPI");
HRESULT rv = appPTR->GetNamespace(s,&nsPTR);
AddressLists* alsPTR;
nsPTR->get_AddressLists(&alsPTR);
AddressList* alPTR;
tagVARIANT ndx;
alsPTR->Item(ndx, &alPTR);
As you can see, I have used the ATL COM wizard to get a bunch of stuff set
up, and everything compiles down to the last shown line. But I have
searched the documents and the tlh file for Outlook, and I can not find
information on what Item wants for the first argument. Yes, I know it wants
a variant, but what value can I give it in order to get a single list
containing all the contact information Outlook has?
What makes this especially annoying is that it seems that all the Outlook
object model documentation seems to be using VB, and VB seems to use a very
different interface.
I NOW have another question, which may or may not make my first irrelevant.
On the diagram I have for the Outlook Object Model, ContactItem is not
shown. However, I find it in the index, and the page describing it makes it
appear that it is what I want to work with. I know I can create a new one
through _Application::CreateItem, but how do I get the ContactItem that has
just been either edited or deleted? Do I go through AddressLists to get
this information or through some other path?
Thanks,
Ted
// _IDTExtensibility2
STDMETHOD(OnConnection)(IDispatch * Application, ext_ConnectMode
ConnectMode, IDispatch * AddInInst, SAFEARRAY * * custom)
{
appObj = (_Application*) Application;
_Application* appPTR = appObj;
_NameSpace* nsPTR;
BSTR s = SysAllocString(L"MAPI");
HRESULT rv = appPTR->GetNamespace(s,&nsPTR);
AddressLists* alsPTR;
nsPTR->get_AddressLists(&alsPTR);
AddressList* alPTR;
tagVARIANT ndx;
alsPTR->Item(ndx, &alPTR);
As you can see, I have used the ATL COM wizard to get a bunch of stuff set
up, and everything compiles down to the last shown line. But I have
searched the documents and the tlh file for Outlook, and I can not find
information on what Item wants for the first argument. Yes, I know it wants
a variant, but what value can I give it in order to get a single list
containing all the contact information Outlook has?
What makes this especially annoying is that it seems that all the Outlook
object model documentation seems to be using VB, and VB seems to use a very
different interface.
I NOW have another question, which may or may not make my first irrelevant.
On the diagram I have for the Outlook Object Model, ContactItem is not
shown. However, I find it in the index, and the page describing it makes it
appear that it is what I want to work with. I know I can create a new one
through _Application::CreateItem, but how do I get the ContactItem that has
just been either edited or deleted? Do I go through AddressLists to get
this information or through some other path?
Thanks,
Ted