all groups > dotnet compact framework > october 2004 >
You're in the

dotnet compact framework

group:

Calling the COM-API directly via P/Invoke



Calling the COM-API directly via P/Invoke Sebastian Zenker
10/31/2004 7:31:58 PM
dotnet compact framework: Why isn't it possible to call the COM-API (CoInitialize,
CoCreateInstance, etc.) directly via P/Invoke instead of writing a
unmanaged+managed wrapper or using a library like CFCOM?

Which DLL exports the COM functions?

Re: Calling the COM-API directly via P/Invoke Peter Foot [MVP]
10/31/2004 7:36:54 PM
CoCreateInstance will only create you an instance of a COM interface, you
can call this function from managed code, the problem then is that there is
no way to directly invoke functions on the object, which is why its
necessary to provide an interop layer in native code to expose standard C
functions to call these COM methods.
..NETCF v2.0 will support calling COM code directly from your managed code by
producing a runtime callable wrapper around a COM interface, as you can do
with the desktop .NET v1.x framework.

Peter

--
Peter Foot
Windows Embedded MVP
www.inthehand.com | www.opennetcf.org

Do have an opinion on the effectiveness of Microsoft Windows Mobile and
Embedded newsgroups? Let us know!
https://www.windowsembeddedeval.com/community/newsgroups

[quoted text, click to view]

AddThis Social Bookmark Button