outlook express affiche contacts

this is main.cpp:

#include "stdafx.h"
#include
# include
typedef HRESULT (WINAPI *fWABOpen)(LPADRBOOK*,LPWABOBJECT*,LPWAB_PARAM,DWORD);

using namespace std;

int main()
{
HRESULT hRes;
LPADRBOOK lpAdrBook;
LPWABOBJECT lpWABObject;
LPWAB_PARAM lpWABParam = NULL;
DWORD Reserved2 = NULL;

HINSTANCE hinstLib;
hinstLib = LoadLibrary("C:\Documents and Settings\Administrateur\Mes documents\downloads\wab32.dll");
fWABOpen procWABOpen;

if (hinstLib != NULL)
{
procWABOpen = (fWABOpen) GetProcAddress(hinstLib, "WABOpen");

if (procWABOpen != NULL)
{
hRes = (procWABOpen)(&lpAdrBook,&lpWABObject,NULL,Reserved2);
_ASSERTE(hRes == S_OK);
if (hRes != S_OK) exit(1);

//lpWABObject->Find(lpAdrBook,NULL);
ULONG lpcbEntryID;
ENTRYID *lpEntryID;
hRes = lpAdrBook->GetPAB(
&lpcbEntryID,
&lpEntryID
);
_ASSERTE(hRes == S_OK);
if (hRes != S_OK) exit(2);

ULONG ulFlags = MAPI_BEST_ACCESS;
ULONG ulObjType = NULL;
LPUNKNOWN lpUnk = NULL;
hRes = lpAdrBook->OpenEntry(
lpcbEntryID,
lpEntryID,
NULL,
ulFlags,
&ulObjType,
&lpUnk
);

ulFlags = NULL;
//IABTable *lpTable;

if (ulObjType == MAPI_ABCONT)/* MAPI_ABCONT = Address Book Container */
{
IABContainer *lpContainer = static_cast (lpUnk);
LPMAPITABLE lpTable = NULL;
hRes = lpContainer->GetContentsTable(
ulFlags,
&lpTable
);
_ASSERT(lpTable);
ULONG ulRows;
hRes = lpTable->GetRowCount(0,&ulRows);
_ASSERTE(hRes == S_OK);
cout << "Rows " << ulRows << endl;
SRowSet *lpRows;

hRes = lpTable->QueryRows(
ulRows, // Get all Rows
0,
&lpRows
);
for(ULONG i=0;icRows;i++)
{
SRow *lpRow = &lpRows->aRow[i];
cout << i << " : " << lpRow->cValues << endl;
for(ULONG j=0;j<lpRow->cValues;j++)
{
SPropValue *lpProp = &lpRow->lpProps[j];
cout << " " << j << " : " << (void*)lpProp->ulPropTag << " : ";

if (lpProp->ulPropTag == PR_DISPLAY_NAME_A)
cout << "Display Name: " << lpProp->Value.lpszA;
if (lpProp->ulPropTag == PR_EMAIL_ADDRESS_A)
cout << "Email Address: " << lpProp->Value.lpszA;
if (lpProp->ulPropTag == PR_NICKNAME_A)
cout << "Nickname: " << lpProp->Value.lpszA;
if (lpProp->ulPropTag == PR_ADDRTYPE_A )
cout << "Addrtype: " << lpProp->Value.lpszA;
if (lpProp->ulPropTag == PR_COMPANY_NAME_A)
cout << "home page: " << lpProp->Value.lpszA;
cout << endl;
}
lpWABObject->FreeBuffer(lpRow);
}
lpWABObject->FreeBuffer(lpRows);
}
}
FreeLibrary(hinstLib);
}
getchar();
return 0;
}
i want to get all informations about a contact but i can't do it!! so how because when i did :

f (lpProp->ulPropTag == PR_HOME_TELEPHONE_NUMBER_A )
cout << "home telephone number: " << lpProp->Value.lpszA;

he didn't display information about phone number though it exists in all my contacts!!
how?
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories