COM Interop

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am using VS 2005 Beta 1 and CF 2.0. I have a old COM server (dll ) which I
would like to call from the PPC client app. I have added the reference and
am able to build. However the "new" call throws a runtime COMException. The
exception code is -2147221164.
Am in the process of installing beta2 now, but I dont think that would help.
Pls let me know as to what I am missing.

Regards
Vidya
 
This error code simply means that the class is not registered. Remeber that
your CF project will not register the referenced COM server - you need to do
it yourself.
 
I have checked that the CLSID entry is present in the registry. Also I can
see the dll and the methods exposed in the object browser on the VS 2005.

Regards
Vidya
 
Would it be possible for you to try instantiating this object from C++ code?
Something has got to be wrong there
 
Are you indicating on the statement-"One caveat, in Beta 1 you will not be
able to do this for COM components which have a dependency on other DLLs."
If so, my COM component doesnt have any dependent dlls. It doesnt use MFC
either. To try and get this working, I created a simple ATL COM project
which doesnt use MFC. It just has one method which basically does nothing!
But, the new itself is failing. In fact, I am able to do a new even from a
..NET windows Application client.
Have you tried using Interop with Beta 1 of CF2.0 and VS2005?

Regards
Vidya
 
Alex
I didnt realise that the COM object needs to be separately registered on the
emulator. I cant find regsvrce.exe anywhere on the emulator. And as I am
not using WindE I cant find it on my machine either. I checked my PPC also,
which is an IPAQ device. It also doesnt have this file. Do you know where I
can get this file for IPAQ device or for PPC2003 emulator.

Regards
Vidya
 
I could find a compatible regsvrce and copied it to the windows folder. On
trying to register my dll, it gives "GetLastError returns C1".
 
According to the Error Lookup tool in eVC 4, that indicates that something
was not a valid Win32 application. Most likely, your COM object was not
properly targeted at the emulator, or something of that sort (or maybe the
version of regsvrce that you ran wasn't).

Paul T.
 
As Paul points out, you need to use a correct COM component build on the
emulator. Not a generic x86 but the one built with Target - Emulator
 
Can you pls tell me how to build a C++ COM dll on a Win2k machine with the
Target as Emulator. If I change the subsystem property in the link settings
of the COM project to subsystem:windowsce, it gives me a linker error.
 
Fianlly got this working...Used eVC4 to build a emulator compatible COM dll
and am able to create and call it from PPC client!

Thanks all for your help..
 
Back
Top