我有一个现成的产品,它支持 C++ 插件。
我想知道是否可以从非托管 C++ dll 调用 C# Dll,以便我可以在我熟悉的 C# 中完成繁重的工作,并仅使用 C++ 插件从 C# Dll 调用和返回值。
我使用的是 WindowsCE,它使用 .net compact framework,这意味着用/CLI 标志编译 C++ 不是一个选项。
任何人都可以向我解释一下我该怎么做。我不是 C++ 开发人员,但如果我给出一个简单的示例,我相信我可以解决这个问题。
我曾在网上寻找一些简单的东西,例如 hello world 应用程序,但什么都找不到。
谢谢。
参见:Hosting ActiveX Controls in the .NET Compact Framework 2.0
COM support in the .NET Compact Framework 2.0 is still somewhat
limited compared to its desktop computer counterpart. For example,
there is no support for external activation. You cannot write a
standalone COM component in managed code; if it were possible, a COM
component could have been instantiated inside a regular, unmanaged
Win32 process. Because managed code requires the Common Language
Runtime (CLR) to execute, such setup needs the Win32 process to host
CLR. Because CLR hosting is not one of the features of the .NET
Compact Framework 2.0, the whole external activation model is not
available.