从 c++ com 加载项调用 C# [英] calling C# from c++ com add-in

查看:16
本文介绍了从 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#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆