COM +

  • Thread starter Thread starter Romain TAILLANDIER
  • Start date Start date
R

Romain TAILLANDIER

hi group

I try to create a COM object using .net.

i think i have found what i need to use, but it doesn't exist in
CompactFramework : ComRegisterFunctionAttribute,
ComUnregisterFunctionAttribute

How can i do it ? work arround it ?

thank you for your help
ROM
 
As I understand it there is no COM support in the compact framework...

A big bummer is that we get no COM interoperability, which means the
compact CLR doesn't include the COM marshaler from .NET that is able to
translate inbound and outbound calls between .NET objects and COM
objects. Windows CE does support COM and this limitation of .NETcf
makes it difficult for your mobile code to "talk" to mobile COM
libraries, such as the Pocket Outlook Object Model (POOM). COM Interop
was omitted because of size and mobile resource considerations. It was
important to keep the size of the mobile CLR down and COM Interop was
simply too expensive. Your only way out of a .NETcf application domain
is Platform Invoke (P/Invoke), which enables you to call Win32 DLLs in
Windows CE, whether they are native or third party in nature. COM
objects would then have to be "wrapped" using a native message-based
DLL built with eVC++. This native wrapper would make all the COM
interactions and your .NET application would talk to the wrapper
through P/Invoke. Interoperability and COM Interop in .NETcf is too big
a topic for the scope of this article, so I'll come back to it in a
future issue. Also, note that there is no support in .NETcf for writing
a COM object.

http://www.devx.com/codemag/Article/17441/0/page/6

Chris
 
As I understand it, there is no COM support in the compact framework...

A big bummer is that we get no COM interoperability, which means the
compact CLR doesn't include the COM marshaler from .NET that is able to
translate inbound and outbound calls between .NET objects and COM
objects. Windows CE does support COM and this limitation of .NETcf
makes it difficult for your mobile code to "talk" to mobile COM
libraries, such as the Pocket Outlook Object Model (POOM). COM Interop
was omitted because of size and mobile resource considerations. It was
important to keep the size of the mobile CLR down and COM Interop was
simply too expensive. Your only way out of a .NETcf application domain
is Platform Invoke (P/Invoke), which enables you to call Win32 DLLs in
Windows CE, whether they are native or third party in nature. COM
objects would then have to be "wrapped" using a native message-based
DLL built with eVC++. This native wrapper would make all the COM
interactions and your .NET application would talk to the wrapper
through P/Invoke. Interoperability and COM Interop in .NETcf is too big
a topic for the scope of this article, so I'll come back to it in a
future issue. Also, note that there is no support in .NETcf for writing
a COM object.

http://www.devx.com/codemag/Article/17441/0/page/6


Chris
 
There is some COM interop support in CF v2.0. If you are using that please
visit msdn2 for details or post back with the specific problem.

Cheers
Daniel
 
Chris,

This is not exactly accurate. There *is* COM support in CF2. There *is* a
COM marshaller (works both ways). It seems like you are talking about CF1.

What CF2 does not have is a support for external COM activation, i.e.
abililty to write COM objects in .NET and have them instantiated by native
applications using CoCreateInstance. Unfortunately this is also what the OP
wants.

A bit more information on COM in CF2 can be found here:
http://msdn.microsoft.com/library/d...-us/dnnetcomp/html/com_interop.asp?frame=true
 
Back
Top