Has anyone had any success in accessing the "Windows Address Book" from VFP?
I know I can go through Outlook automation (and I will), but I wanted another way for clients who don't have Outlook installed (since, I belive, Outlook Express also uses the WAB, and doesn't support automation).
a VB.net example is here:
a C example is here:
and here:
a reference to the WAB api for C is here:
The basic trouble with using the C-code is that, while the WAB api is COM-based it is not ActiveX: the WABOpen is a class factory for the IAddrBook interface, which cannot (as far as I can tell) be instantiated directly through CreateObject.
Anyone know how to call a method through an IDispatch interface from VFP?
(basically: what is the VFP translation of:
I know VFP can "implement interfaces", but I think that is the exact opposite of what is needed here...
- Bill
Get the best answers to your questions -- See FAQ481-4875.
I know I can go through Outlook automation (and I will), but I wanted another way for clients who don't have Outlook installed (since, I belive, Outlook Express also uses the WAB, and doesn't support automation).
a VB.net example is here:
a C example is here:
and here:
a reference to the WAB api for C is here:
The basic trouble with using the C-code is that, while the WAB api is COM-based it is not ActiveX: the WABOpen is a class factory for the IAddrBook interface, which cannot (as far as I can tell) be instantiated directly through CreateObject.
Anyone know how to call a method through an IDispatch interface from VFP?
(basically: what is the VFP translation of:
Code:
//I know this line can be xlated to a DECLARE-DLL statement in VFP:
ssWABOpen = (fWABOpen)GetProcAddress(hModule, "WABOpen");
//And this line can be a simple function call,
// returning the pointer as a number,
// or, probably, returning the object as a string,
// though that would seem to be useless...
HRESULT hr = (ssWABOpen)(&lpAddrBook, &lpWABObject, NULL, 0);
// This is where I get stuck: is there an API to
// "dereference" the "OpenEntry" method from the COM
// object pointer (number) returned from WABOpen?
hr = lpAddrBook->OpenEntry(lpcbEntryID, lpEntryID,
NULL, ulFlags, &ulObjType, &lpIUnknown);
I know VFP can "implement interfaces", but I think that is the exact opposite of what is needed here...
- Bill
Get the best answers to your questions -- See FAQ481-4875.