Pelles C forum

C language => Pocket PC and Smartphone questions => Topic started by: ajige on February 24, 2009, 01:16:38 am

Title: Pocket Outlook / POOM/ pimstore
Post by: ajige on February 24, 2009, 01:16:38 am
Has anyone been able to compile an application with PellesC to get information from Pocket Outlook' tasks and appointments?
I have tried various samples from the web, but without any success. One problem is, I can't find the file pimstore.lib which might be essential. Is there any other way to access Pocket outlook items?
Any help would be greatly appreciated.
Title: Re: Pocket Outlook / POOM/ pimstore
Post by: ajige on February 25, 2009, 06:16:47 pm
Never mind - I finally figured it out. If anyone  else needs it:
1) Used the following headers:
Code: [Select]
#include <objbase.h>
#define INITGUID
#include <initguid.h>
#include <windows.h>
#include "pimstore.h"
2) Added ole32.lib to the Project linker page
3) Rewrote the functions as per the pimstore.h file for c code (as most info on the web is c++ code)

The following code will show tasks:
Code: [Select]
IFolder  *pFolder=NULL;
IPOutlookItemCollection *pTasks;
int olFolderTasks =13;
IPOlItems *pItem;
ITask *pTask;
//Initialize COM for Pocket Outlook
if (FAILED(CoInitializeEx(NULL, 0))) return FALSE;
// Get the application object
IPOutlookApp *polApp;
BSTR bstrVersion;
hr = CoCreateInstance(&CLSID_Application, NULL, CLSCTX_INPROC_SERVER, &IID_IPOutlookApp, (LPVOID *)&polApp);
if (FAILED(hr)) return FALSE;

polApp->lpVtbl->GetDefaultFolder(polApp,olFolderTasks, &pFolder);
 pTasks->lpVtbl->QueryInterface(pTasks,&IID_IPOlItems, (LPVOID *) &pItem);
int numItems,i;
for (i = 1; i <=numItems; i++)
pItem->lpVtbl->Item(pItem,i, (IDispatch **) &pTask);
MessageBox(hwndDlg,Fname,TEXT("Task subject"),MB_OK);

hr = polApp->lpVtbl->get_Version(polApp,&bstrVersion);
MessageBox (hwndDlg,bstrVersion,TEXT("POOM version"),MB_OK );


I just hope I'm using the lpVtbl part correctly, since I don't really have a clue what's going on with that.

But the code is working. :)