Never mind - I finally figured it out. If anyone else needs it:
1) Used the following headers:
#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:
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;
HRESULT hr;
BSTR bstrVersion;
hr = CoCreateInstance(&CLSID_Application, NULL, CLSCTX_INPROC_SERVER, &IID_IPOutlookApp, (LPVOID *)&polApp);
if (FAILED(hr)) return FALSE;
polApp->lpVtbl->Logon(polApp,0);
polApp->lpVtbl->GetDefaultFolder(polApp,olFolderTasks, &pFolder);
pFolder->lpVtbl->get_Items(pFolder,&pTasks);
pTasks->lpVtbl->QueryInterface(pTasks,&IID_IPOlItems, (LPVOID *) &pItem);
int numItems,i;
pItem->lpVtbl->get_Count(pItem,&numItems);
for (i = 1; i <=numItems; i++)
{
pItem->lpVtbl->Item(pItem,i, (IDispatch **) &pTask);
LPTSTR Fname;
pTask->lpVtbl->get_Subject(pTask,&Fname);
MessageBox(hwndDlg,Fname,TEXT("Task subject"),MB_OK);
}
hr = polApp->lpVtbl->get_Version(polApp,&bstrVersion);
MessageBox (hwndDlg,bstrVersion,TEXT("POOM version"),MB_OK );
polApp->lpVtbl->Logoff(polApp);
polApp->lpVtbl->Release(polApp);
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.