Implementation of POOM Using Embedded Visual C++ 3.0 | CodeGuru

Implementation of POOM Using Embedded Visual C++ 3.0

Environment: EVC++3.0, WinCE, PocketPC SH3 or so The contactMgt is the application which implements POOM and it has been successfully tested on SH3 processor and hope it will work fine on the rest of too. but before try to build it you need to register the DLL’s on your Pocket PC, I choose regsvrce.exe(find out […]

Written By
CodeGuru Staff
CodeGuru Staff
Dec 10, 2001
1 minute read
CodeGuru content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More

Environment: EVC++3.0, WinCE, PocketPC SH3 or so

The contactMgt is the application which implements POOM and it has been successfully tested on SH3 processor and hope it will work fine on the rest of too. but before try to build it you need to register the DLL’s on your Pocket PC, I choose regsvrce.exe(find out in Windows CE Tools folder ) for that. And you know which DLL you have to register (I don’t want to repeat things again and again )

Once register DLL now its very easy

The parameter that is passed is the identifier for the folder that is to be retrieved.

Folder Type Value
Calendar 9
Contacts 10
Tasks 13
Cities 101
Infrared 102

If facing any problem in LINKING use Project->Settings->Link and add /force

//
// Include headers
// in stdafx.h
#include “initguid.h>”
#include “pimstore.h”
// Initialize 
CoInitializeEx(NULL, 0);
hr = CLSIDFromProgID(POA_OBJECT, &clsid);
if (FAILED(hr))
{
 AfxMessageBox(_T(“Fail to load CLSID”));
}
else
{
 hr = CoCreateInstance(clsid,
                       NULL,
                       CLSCTX_INPROC_SERVER,
                       IID_IPOutlookApp,
                       (LPVOID *) &(polApp));
 if (FAILED(hr))
 {
  err = GetLastError();
  sprintf(str,”Fail to load CoCreateInstance %d”,err);
  AfxMessageBox((CString)str);
 }
}
// ///////////in header file
IPOutlookApp    *polApp; // outlook app
IFolder *pFolder;
IPOutlookItemCollection *pContacts;
IPOlItems *pItem;
IContact *pContact;
HRESULT hr;
CLSID clsid;
///////////////And Implementation is here
BSTR pwszVersion = NULL;
CString firstname,lastname,fullname;
CListBox* List1=(CListBox *)GetDlgItem(IDC_LIST1);
List1->ResetContent();
int olFolderContacts = 10;
hr = polApp->Logon(NULL);
if (FAILED(hr))
{
 AfxMessageBox(_T(“Fail to login”));
}
else
{
 polApp->get_Version(&pwszVersion);
 polApp->GetDefaultFolder(olFolderContacts, &pFolder);
 pFolder->get_Items(&pContacts);
 pContacts->QueryInterface(IID_IPOlItems, (LPVOID *) &pItem);
 int numItems,i;
 pItem->get_Count(&numItems);
 for (i = 1; i <= numItems; i++)
 {
  pItem->Item(i, (IDispatch **) &pContact);
  LPTSTR Fname,Lname;
  pContact->get_FirstName(&Fname);
  pContact->get_LastName(&Lname);
  firstname =(CString)Fname;
  lastname = (CString)Lname;
  fullname = firstname + ” ” + lastname;
  List1->AddString((CString)fullname);
 }
}
//

Downloads

Download source – 285 Kb

Download demo application – 5 Kb

CodeGuru Logo

CodeGuru covers topics related to Microsoft-related software development, mobile development, database management, and web application programming. In addition to tutorials and how-tos that teach programmers how to code in Microsoft-related languages and frameworks like C# and .Net, we also publish articles on software development tools, the latest in developer news, and advice for project managers. Cloud services such as Microsoft Azure and database options including SQL Server and MSSQL are also frequently covered.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.