简体   繁体   中英

COM Interop on Windows Mobile 6

I have an application written in C++ and MFC (VS 2008 SP1) which is running on Windows Mobile 6.1. Now I need to integrate functionalities into this application which is only available through a .NET library from a third-party supplier.

My idea was to create my own wrapper/facade .NET assembly around this .NET library which exposes the functions I need for my project and to make this assembly COM-visible for my C++/MFC project.

When setting up a project in VS 2008 for this wrapper library (C#, "Smart Device" project type, type "class library", target framework .NET 2.0 (or 3.5), target platform "Windows Mobile 6 Professional SDK") I noticed that the options in the project properties to make the assembly COM-visible and to register for COM-Interop are disabled (grayed out in the dialog masks in VS).

(When I create a "normal" (not for Smart Device) class library project for framework 2.0 the options are available.)

Questions:

  • 1) Is COM-Interop supported on Windows Mobile at all?
  • 2) If so, is this special direction of COM-Interop I need (make .NET assemblies COM-visible to native applications) supported on Windows Mobile?
  • 3) If so, am I doing something wrong by setting up the project?
  • 4) Do I have any other options to solve the problem described in the first paragraph above?

Thank you very much for help in advance!

You cannot create a managed COM object in the CF because Hosting is not supported.

The only way to call into managed code from native (aside from callbacks, etc initiated from the managed side) is to create a separate managed executable running in its own process and use IPC.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM