Groups | Blog | Home
all groups > dotnet compact framework > april 2005 >

dotnet compact framework : COM Interop


Vidya
4/18/2005 9:49:02 PM
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
Alex Feinman [MVP]
4/18/2005 11:11:10 PM
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.

--
Alex Feinman
---
Visit http://www.opennetcf.org
[quoted text, click to view]
Vidya
4/18/2005 11:22:02 PM
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

[quoted text, click to view]
Alex Feinman [MVP]
4/19/2005 12:13:16 AM
Would it be possible for you to try instantiating this object from C++ code?
Something has got to be wrong there

--
Alex Feinman
---
Visit http://www.opennetcf.org
[quoted text, click to view]
Vidya
4/19/2005 5:25:01 AM
Am able to do that from VC client as well as VB client.

[quoted text, click to view]
Vidya
4/19/2005 10:04:02 PM
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

[quoted text, click to view]
Johann Granados
4/19/2005 10:08:30 PM
You should read this. Maybe that helps ...
http://msdn.microsoft.com/smartclient/community/cffaq/cf20.aspx#pnfahk95

Best regards,

Johann Granados
MVP .NET Compact Framework

[quoted text, click to view]

Vidya
4/20/2005 4:55:01 AM
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

[quoted text, click to view]
Vidya
4/20/2005 5:24:04 AM
I could find a compatible regsvrce and copied it to the windows folder. On
trying to register my dll, it gives "GetLastError returns C1".

[quoted text, click to view]
Paul G. Tobey [eMVP]
4/20/2005 8:54:06 AM
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.

[quoted text, click to view]

Alex Feinman [MVP]
4/20/2005 12:49:10 PM
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

--
Alex Feinman
---
Visit http://www.opennetcf.org
[quoted text, click to view]
Vidya
4/20/2005 9:40:01 PM
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.


[quoted text, click to view]
Vidya
4/22/2005 2:04:02 AM
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..

[quoted text, click to view]
AddThis Social Bookmark Button