关于从C#到C ++ DLL项目访问COM对象 [英] About accessing COM objects from C# to C++ dll project

查看:103
本文介绍了关于从C#到C ++ DLL项目访问COM对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在c#应用程序中工作。我通过C ++ DLL项目的包装器使用了一些方法。

I am working in c# application. I have used some method through wrapper from C++ dll project.

我想将数据作为参数传递给c#到C ++ dll的包装器方法。

I want to pass data as an argument to wrapper methods from c# to C++ dll.

这个问题可能有两种方法。

there may be two ways for this issue.

1)以基本数据类型作为参数发送数据,2)发送COM对象作为参数。

1)send data in basic data types as arguments and 2) send COM object as argument.

目前,我在C#中使用COM对象。那么,请告诉我如何在C ++ DLL中使用COM对象?

currently, I am using COM objects in C#.So, Please tell me how to use COM object in C++ dll?

提前致谢。

推荐答案

您好Ganesh_Chavan,

Hi Ganesh_Chavan,

感谢您发布此处。

对于您的问题,请执行你的意思是你想在C#中调用C ++ DLL?并且你想在C ++ DLL中使用COM对象来从C#调用?

For your question, do you mean you want to call C++ DLL in C#? And you want to use COM object in C++ DLL to call from C#?

如果你想从C#中获取C ++ DLL,你可以参考下面的链接。

If you want to C++ DLL from C#, you could refer to the link below.

https://social.msdn.microsoft.com/Forums/vstudio/en-US/dbafec35-0759-4dde-9048-d1c0c80a2ffb/use-managed-c-class-library-with- c?forum = netfxbcl

您想查看下面有关如何在C ++中使用COM对象的链接。

You would like to check the link below about how to use COM object in C++.

https://stackoverflow.com/questions/2187425/怎样使用-c-dll-with-loadlibrary-in-c

https://www.codeproject.com/Articles/338268/COM-in-C

如果你的问题是关于如何在C ++中使用COM,你可以在
中发布一个新线程
C ++论坛

If your question is about how to use COM in C++, you could post a new thread in C++ forum.

最诚挚的问候,

Wendy


这篇关于关于从C#到C ++ DLL项目访问COM对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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