c# - 从 WindowsCE 上的非托管 C++ 应用程序调用 C# Dll

标签 c# c++ compact-framework windows-ce unmanaged

<分区>

我有一个现成的产品,它支持 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.

关于c# - 从 WindowsCE 上的非托管 C++ 应用程序调用 C# Dll,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15906493/

相关文章:

C# ASP.NET Core [Inject] 依赖注入(inject)的属性用法

C++ 开启数据类型

c++ - 如何模拟 remove_unless

c# - 如果先前接收到数据,SerialPort.Open() 会卡住系统(紧凑框架)

c# - 与 Apache ActiveMQ 兼容的 .NET Compact Framework 3.5 消息传递框架?

c# - 反复使用Form Constructor刷新标签文字

c# - 如何使用 ConfigurationManager 打开配置文件应用程序设置?

C++/(MFC dummy) 和纯 Win MessageBox() - 如何删除消息队列或以其他方式删除现有的鼠标点击/按键缓冲区

visual-studio-2008 - 如何调试通过无线网络运行的 Pocket PC 应用程序?

c# - ViewModel 和 Model 之间的 WPF 绑定(bind)