从 c++ com 加载项调用 C#

0

本文介绍了从 c++ com 加载项调用 C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我有一个用 C++(不是 C++/CLI)编写的 COM 插件.我想从这个 C++ com 库中调用一个 C# 库对象/方法.

I have a COM add-in written in C++ (not C++ / CLI). I want to call a C# library objects/methods from this C++ com library.

我想 CCW 在这里出现了,我目前正在阅读.

I guess the CCW comes into picture here, which i am currently reading about.

根据您的经验,有没有关于这些内容的快速指示?

Are there any quick pointers to this stuff from your experience?

另外,我的 Com 加载项中有一个方法,我希望我的 C# 库代码调用它 - 即方法指针调用.

Also, i have a method in my Com add-in that i would like my C# library code to call - i.e. a method pointer invocation.

你能帮我告诉我该怎么做吗 - 即我如何将方法指针传递给 C# 代码,以便以后可以调用它.

Can you help telling me how i can do this please - i.e. how do i go about passing the method pointer to the C# code so it can call on it later.

谢谢.

推荐答案

我有这个链接给你:
COM 互操作第 1 部分示例
从 .Net 环境中创建 DCOM 应用程序:第五部分
C++ 到 C# 调用

这篇关于从 c++ com 加载项调用 C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

C# 中的多播委托奇怪行为?
Multicast delegate weird behavior in C#?(C# 中的多播委托奇怪行为?)...
2023-11-11 C#/.NET开发问题
6

参数计数与调用不匹配?
Parameter count mismatch with Invoke?(参数计数与调用不匹配?)...
2023-11-11 C#/.NET开发问题
26

如何将代表存储在列表中
How to store delegates in a List(如何将代表存储在列表中)...
2023-11-11 C#/.NET开发问题
6

代表如何工作(在后台)?
How delegates work (in the background)?(代表如何工作(在后台)?)...
2023-11-11 C#/.NET开发问题
5

没有 EndInvoke 的 C# 异步调用?
C# Asynchronous call without EndInvoke?(没有 EndInvoke 的 C# 异步调用?)...
2023-11-11 C#/.NET开发问题
2

Delegate.CreateDelegate() 和泛型:错误绑定到目标方法
Delegate.CreateDelegate() and generics: Error binding to target method(Delegate.CreateDelegate() 和泛型:错误绑定到目标方法)...
2023-11-11 C#/.NET开发问题
14