Hello,

I'm currently playing with the PocketPC SDK 2003 and ActiveSync, in
order to use POOM. I've tried a very basic piece of code but it doesn't
work.

...
HRESULT hr = S_OK;
IPOutlookApp *pOlApp = NULL;

if (FAILED(CoInitializeEx(NULL, 0)))
{
printf("CoInitializeEx() failed !\n");
return FALSE;
}

hr = CoCreateInstance(CLSID_Application, NULL, CLSCTX_INPROC_SERVER,
IID_IPOutlookApp, (LPVOID *)&pOlApp);
if (FAILED(hr))
{
printf("CoCreateInstance failed : hr = %x\n", hr);
return FALSE;
}
...

When run, the result is :

CoCreateInstance failed : hr = 80040154

Taken from winerror.h, it means REGDB_E_CLASSNOTREG, or "class not
registered". Where does this error come from ? Do I have to registered a
DLL ? Or something like this ?

My setup is :
- MS Toolkit 2003 (compiler)
- PocketPC SDK 2003 (and eVC++ 4)
- ActiveSync 3.7.1

Thanks,

Damiano

Re: [COM ?] ActiveSync provider & POOM issues by Damiano

Damiano
Fri Jul 09 05:37:02 CDT 2004

Tobias wrote:
> Hello,
>
> I'm not sure whether this solves your problem. Generally you will
> have to initiate the GUID's. Doing so, you will be able to access
> the Data from Pocket Outlook...
>
> Before any "#include" you must place the following line of code:
>
> #define INITGUID
>
> INITGUID is defined in "pimstore.h" and specifies a class identifier,
> which you use by CLSID_Application. This is the main object which
> all other objects are derived from.
>
> Sometimes some compiler problems occour by interpreting the
> INITGUID in combination with CLSID_Application. To solve this
> you will have to define the CLSID_Application parameter by hand.
>
> To your code.
>
> By using CoInitializeEx() the second parameter must be COINIT_MULTITHREADED
> (i think the API said so)
>
> Should work!
>

Hello,

Thanks for taking time to look at my problem. Unfortunately, it still
doesn't work :(

I had already put the '#define INITGUID' in my code, I just didn't quote
it entirely. And putting COINIT_MULTITHREADED didn't have any effect.

What is strange is that IID_IPOutlookApp resolve to a CLSID not present
in the registry. As I'm no expert in Windows programming, I can't say if
it's a problem. May it be ? Is there an interface I can try, one that is
always present on a Windows system ?

Cheers,

--
Damiano ALBANI

Re: [COM ?] ActiveSync provider & POOM issues by Tobias

Tobias
Mon Jul 12 03:42:06 CDT 2004

Hello again

Did you try to define the "DEFINE_GUID" command in "pimstore.h" by hand. As i refer
there are comliler problems by interpreting the IID_IPOutlookApp parameter

The IID_IPOutlookApp is a Reference to the identifier of the interface to be used to communicate with the object. That is the Pocket Outlook Main Object

So try to define the DEFINE_GUID command by hand in the following manner

This is the current definition in "pimstore.h"

DEFINE_GUID (IID_IPOutlooApp, 0x?, 0x?, 0x?, 0x?, 0x?, 0x?, 0x?, 0x?, 0x?, 0x?, 0x?)

Try to define it that way

EXTERN_C const GUID IID_IPOutlookApp{ 0x?, 0x?, 0x?, {0x?, 0x?, 0x?, 0x?, 0x?, 0x?, 0x?, 0x?} }
It's the same because DEFINE_GUID is defined that way in "objbase.h" which is include
in your project

The interrogation mark represents a value which you find in "pimstore.h" where th
definition of IID_IPOutlookApp is made

(To find the definition of IID_IPOutlookApp mark the parameter by double clicking an
use the popup option "Go To Definition Of IID_IPOutlookApp" or any other way...)

If you don't do so, the error message looks like this

OutlookAccess.obj : error LNK2001: unresolved external symbol _IID_IPOutlookAp
X86EMDbg/OutlookAccess.exe : fatal error LNK1120: 1 unresolved external
Error executing link.exe
Creating browse info file..

Hope this will help you

Best Regards
Tobias

Re: [COM ?] ActiveSync provider & POOM issues by Paul

Paul
Mon Jul 12 07:25:13 CDT 2004

I suggest you use the registry editor to see if there is an entry for
[HKEY_CLASSES_ROOT\CLSID\{05058F23-20BE-11D2-8F18-0000F87A4335}] on the
device

Ensure there is at least InProcServer32 registry key with a default value of
pimstore.dll

If is it not there then you will need to register the PIMSTORE.DLL by
calling the DLLRegisterServer exported by pimstore.dll

It is also possible you might need to change your entry for
CLSCTX_INPROC_SERVER to CLSCTX_ALL.

Paul
www.toddsoftware.com


"Tobias" <Tobias@discussions.microsoft.com> wrote in message
news:2668D3C1-B305-45A4-83CF-F77152DFF1F4@microsoft.com...
> Hello again,
>
> Did you try to define the "DEFINE_GUID" command in "pimstore.h" by hand.
> As i refer,
> there are comliler problems by interpreting the IID_IPOutlookApp
> parameter.
>
> The IID_IPOutlookApp is a Reference to the identifier of the interface to
> be used to communicate with the object. That is the Pocket Outlook Main
> Object.
>
> So try to define the DEFINE_GUID command by hand in the following manner:
>
> This is the current definition in "pimstore.h":
>
> DEFINE_GUID (IID_IPOutlooApp, 0x?, 0x?, 0x?, 0x?, 0x?, 0x?, 0x?, 0x?, 0x?,
> 0x?, 0x?);
>
> Try to define it that way:
>
> EXTERN_C const GUID IID_IPOutlookApp{ 0x?, 0x?, 0x?, {0x?, 0x?, 0x?, 0x?,
> 0x?, 0x?, 0x?, 0x?} };
> It's the same because DEFINE_GUID is defined that way in "objbase.h" which
> is included
> in your project.
>
> The interrogation mark represents a value which you find in "pimstore.h"
> where the
> definition of IID_IPOutlookApp is made.
>
> (To find the definition of IID_IPOutlookApp mark the parameter by double
> clicking and
> use the popup option "Go To Definition Of IID_IPOutlookApp" or any other
> way...).
>
> If you don't do so, the error message looks like this:
>
> OutlookAccess.obj : error LNK2001: unresolved external symbol
> _IID_IPOutlookApp
> X86EMDbg/OutlookAccess.exe : fatal error LNK1120: 1 unresolved externals
> Error executing link.exe.
> Creating browse info file...
>
> Hope this will help you!
>
> Best Regards,
> Tobias



Re: [COM ?] ActiveSync provider & POOM issues by Damiano

Damiano
Tue Jul 13 07:27:05 CDT 2004

Hello,

Thanks a lot Tobias and Paul for your precious help, but I know where my
problems come from : me and my sillyness ;-)

In fact, I thought that I could use the POOM API in *desktop* apps, like
a remote procedure call using PocketOutlook 'services' from my PC...

Apparently, what I need to do can be handled by a custom Active Sync
provider. My goal is to create a provider for data synchronization with
*Mozilla*, instead of Outlook. For users, it would only be a
drag-and-drop replacement of the 'outstore.dll' file. So I am trying to
'mimick'/copy the existing provider, and, as I've no experience at all
in PPC/Windows programming, that ain't easy !

Any suggestion is welcome :)

Cheers,

--
Damiano