Hi,

I am using following code snippet to display Contact information. It works
fine on Pocket PC 2002. However, on PPC2003, after the Contact dialog
showing up, if I press the 'Show Recording Toolbar' button on Notes page and
then press OK button to close the dialog, IContact::Display() will cause
access violation exception. Is this possible a bug of PPC 2003?? How can I
avoid this problem??

----------------------------------------------------------------------------
------------------------------------------
void CPoomTestDlg::Foo()
{
int iCount;
IPOutlookApp *pIApp;

HRESULT hr;
hr = CoInitializeEx(NULL, COINIT_MULTITHREADED);
if (FAILED(hr)) {
return;
}

hr = CoCreateInstance(CLSID_Application, NULL, CLSCTX_INPROC_SERVER,
IID_IPOutlookApp, (LPVOID *)&pIApp);
if (FAILED(hr)) {
return;
}

hr = pIApp->Logon(NULL); // Logon
if (FAILED(hr)) {
return;
}

IFolder *pIFolder = NULL;
IPOutlookItemCollection *pIItems = NULL;

pIApp->GetDefaultFolder(olFolderContacts, &pIFolder);
if (NULL == pIFolder) {
return;
}

pIFolder->get_Items(&pIItems);
pIItems->get_Count(&iCount);

if (iCount > 0) {
IContact *pIContact;
hr = pIItems->Item(1, reinterpret_cast<IDispatch **>(&pIContact)); // get
first contact

if (SUCCEEDED(hr)) {
pIContact->Display();
}
}

pIFolder->Release();
pIItems->Release();
pIApp->Logoff(); // Logoff Pocket outlook
if (pIApp) {
pIApp->Release();
}

CoUninitialize();
}