Implementation of POOM Using Embedded Visual C++ 3.0
Posted
by Nitin Kumar Garg
on December 10th, 2001
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 KbDownload demo application - 5 Kb

Comments
linker error on CoInitializeEx(...)
Posted by astaples on 05/13/2005 12:48pmI am having linker errors with CoInitializeEx(...) and CoCreateInstance(...) despite adding the "/force" option to my linker. If anyone knows the fix, I'd be very appreciative! -Alan astaples@diyprojectorcompany.com
ReplyWhich DLL
Posted by WillSinger on 03/16/2005 01:00pmI realize I am late to the game here and maybe I missed a previous article, but what DLL is it that needs registered?
ReplyDLL problem....
Posted by Legacy on 01/28/2004 12:00amOriginally posted by: Nitin Gahlaut
Hi,
I have seen your artical on "Codeguru.com" which is realted to WIN CE. So I have a query for you. I know my query is not related with ur code, but please help me, i m in trouble... actaully i could not get any help regarding that problem...
Actually Nitin i m new in Win CE. Thats the prob....
The problem is: I m trying to load some thride party DLL's for finger print verfication. But I when i load that DLL's on emulator through LoadLibrary(), then i got the error, i mean i always get the NULL, and in response error code sometimes "2", somethimes "126".
But when i load some other system DLL's like "Aygshell.DLL" or "richink.DLL" etc. then it will work properly....
One more important thing is there: only one dll which is realted to smart card is working but it is not working on emulator, it works properly only on Pocket PC. so why it not wroking on emulaotor...?
So please tell me why i m not able to get the Handle of that DLL's. And please tell me from where i have to start to find out the solution.
One more thing please tell me that before using that DLL, i have to register that DLL's or not. and if yes then how? Actually i also try to register that DLL's but could not able to register.
Anyway,
Please send the solution of my prob.... or please guid me.... please arreange few min. for writing the reply ..
Waiting for ur resposne....
Nitin Gahlaut
Replynitin_gahlaut@yahoo.com
Add Menu Item to Outlook
Posted by Legacy on 01/14/2004 12:00amOriginally posted by: Jason
Is there a sample around that I can put into one of the VCE++ 3.0 or 4.0 compilers to show me how to do all this.
I am a Delphi programmer, and don't really know how to do this, I'm having enough of a time getting around the Visual C interface let alone getting anything working.
Can someone please help me?!
Jason
ReplyHow to get notification on change in contacts?
Posted by Legacy on 05/22/2003 12:00amOriginally posted by: Boris
Is there a property or signature that can be used to check if contacts collection has been changed? Is it possible to sing on notification on change?
Thanks, Boris.
ReplyI have a question,,,
Posted by Legacy on 02/18/2003 12:00amOriginally posted by: ilseop
Hi,,
I wanna sort the items.
but it does not working.
// incorrect working code
polApp->GetDefaultFolder(olFolderContacts, &pFolder);
pFolder->get_Items(&pContacts);
pContacts->pSort( (BSTR)TEXT("[CompanyName]"), FALSE );
//
Please Help me!!
Thanks!
ReplyModified Date/time of contact
Posted by Legacy on 02/03/2003 12:00amOriginally posted by: Rakesh
I want to get Date/time when a contact is modified last time.
ReplyIt working OK ! :)
Posted by Legacy on 10/10/2002 12:00amOriginally posted by: ApolloVN
ReplyProblems with the code
Posted by Legacy on 08/30/2002 12:00amOriginally posted by: Brad Murdoch
I downloaded the sources provided on the page and attempted to compile for my pocket pc. I get three errors
--------------------Configuration: ContactMgt - Win32 (WCE ARM) Debug--------------------
Compiling...
StdAfx.cpp
Compiling...
AboutContact.cpp
ContactMgt.cpp
ContactMgtDlg.cpp
Generating Code...
Linking...
StdAfx.obj : error LNK2005: IID_IPOutlookApp already defined in ContactMgtDlg.obj
StdAfx.obj : error LNK2005: IID_IPOlItems already defined in ContactMgtDlg.obj
ARMDbg/ContactMgt.exe : fatal error LNK1169: one or more multiply defined symbols found
Error executing link.exe.
ContactMgt.exe - 3 error(s), 0 warning(s)
Replyanyone know whats going on here????
How to ascertain the last modify time of contact?
Posted by Legacy on 02/04/2002 12:00amOriginally posted by: David Liu
As we know, there is a lastmodifytime propertiy at outlook object model on pc. But I can find the propertiy on pocket pc outlook object model. Is there a simple method to ascertain the last modify time of contact? If you know, please send me an email. Tsingslin@163.com
ReplyThanks a lot!