CodeGuru
Earthweb Search
Forums Wireless Jars Gamelan Developer.com
CodeGuru Navigation
Member Sign In
User ID:
Password:
Remember Me:
Forgot Password?
Not a member?
Click here for more information and to register.

jobs.internet.com

internet.commerce
Partners & Affiliates
Server Racks
Televisions
Promotional Golf
Phone Cards
Memory Upgrades
Dental Insurance
Online Education
Cell Phones
Laptops
KVM Switches
Baby Photo Contest
Promotional Pens
Car Donations
Shop Online


RSS Feeds

RSSAll

RSSVC++/C++

RSS.NET/C#

RSSVB

See more EarthWeb Network feeds

Home >> Visual C++ / C++ >> Windows Programming >> CE

Best Practices for Developing a Web Site. Checklists, Tips, Strategies & More. Download Exclusive eBook Now.

Implementation of POOM Using Embedded Visual C++ 3.0
Rating: none

Nitin Kumar Garg (view profile)
December 10, 2001


(continued)



Turbo Screen Sharing
Adobe Acrobat Connect Professional offers users the ability to have a more productive and engaging web conferencing experience while providing the IT department with a program that efficiently utilizes bandwidth and minimally impacts the infrastructure. Learn More! »

Informal Learning: Extending the Impact of Enterprise Ideas and Information
Forward-thinking organizations are turning to enterprise learning in their quest to be better informed, better skilled, better supported at the point of need, and more competitive in their respective marketplaces. Learn More! »

Rapid E-Learning: Maturing Technology Brings Balance and Possibilities
Rapid e-learning addresses both time and cost issues by using technology tools to shift the dynamics of e-learning development. Learn why more skilled learning professionals use these tools and how you can get a solution to keep pace with your business demands. »

Delivering on the Promise of ELearning
This white paper defines the framework to launch e-learning as a set of teaching, training, and learning practices not bound by a specific technology platform or learning management system. It offers practical suggestions for creating digital learning experiences that engage learners by building interest and motivation and providing opportunities for active participation. »

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 TypeValue
Calendar9
Contacts10
Tasks13
Cities101
Infrared102

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

Tools:
Add www.codeguru.com to your favorites
Add www.codeguru.com to your browser search box
IE 7 | Firefox 2.0 | Firefox 1.5.x
Receive news via our XML/RSS feed

Intel Go Parallel Portal: Translating Multicore Power into Application Performance. Learn more.
Becoming a Better Project Manager. Checklists, Tips & Strategies. Download Exclusive eBook Now.
Guide to Developing a Web Site. Best Practices, Tips and Strategies. Download Exclusive eBook Now.
Best Practices for Developing a Web Site. Checklists, Tips & Strategies. Download Exclusive eBook Now.
Is it time to make your move to the multi-threaded and parallel processing world? Find out!


RATE THIS ARTICLE:   Excellent  Very Good  Average  Below Average  Poor  

(You must be signed in to rank an article. Not a member? Click here to register)

Latest Comments:
linker error on CoInitializeEx(...) - astaples (05/13/2005)
Which DLL - WillSinger (03/16/2005)
DLL problem.... - Legacy CodeGuru (01/28/2004)
Add Menu Item to Outlook - Legacy CodeGuru (01/14/2004)
How to get notification on change in contacts? - Legacy CodeGuru (05/22/2003)

View All Comments
Add a Comment:
Title:
Comment:
Pre-Formatted: Check this if you want the text to display with the formatting as typed (good for source code)



(You must be signed in to comment on an article. Not a member? Click here to register)
HP Storage Disaster Proof Enterprise Solutions:
WHITEPAPER:
Using Storage Virtualization and Thin Provisioning to add Capacity
WHITEPAPER:
Remote Replication Best Practices for Oracle10g Using XP Continuous Access
WHITEPAPER:
HP StorageWorks 3 Data Center Replication
ESG LAB REPORT:
Enterprise-Class Storage Virtualization for Mission-Critical IT


JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers