如何在Visual Studio VC ++控制台应用程序中添加dll文件 [英] How to add a dll file in Visual studio VC++ console application

查看:109
本文介绍了如何在Visual Studio VC ++控制台应用程序中添加dll文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在c Sharp中创建了一个类并制作了该类的dll,现在我想使用我的VC ++项目中dll文件中的方法.我知道如何在VC ++项目中添加* .lib文件,但是如何在我不知道的VC ++项目中添加* .dll文件.我想创建我在VC ++项目中的* .dll中定义的类的对象,并希望通过该对象访问其方法. div class ="h2_lin">解决方案

此链接可能对以下目的有用:
http://social.msdn.microsoft.com /forums/zh-CN/vcgeneral/thread/299da822-5539-4e5b-9ba7-b614e564c9f4/ [ http://msdn.microsoft.com/en-us/library/zsfww439 (v = vs.80).aspx [ http://msdn.microsoft.com/en -us/library/system.runtime.interopservices.classinterfaceattribute(v = vs.80).aspx [> COM简介-它是什么,以及如何使用它. [ http://msdn.microsoft.com/en-us/library/ms173184. [ ^ ]

http://msdn.microsoft.com/en-us/library/c3fd4a20.aspx [ ^ ]


I have created a class in the c sharp and made the dll of the class now i want to use the methods in the dll file in my VC++ project.i know how to add the *.lib file in VC++ project but how to add a *.dll file in VC++ project i don''t know.I want to create the object of the class that i defined in the *.dll in my VC++ project and through the object i want to access its methods.

解决方案

This link could be useful for such a purpose:
http://social.msdn.microsoft.com/forums/en-US/vcgeneral/thread/299da822-5539-4e5b-9ba7-b614e564c9f4/[^]

upd:
Try this documentation
Exposing .NET to COM
http://msdn.microsoft.com/en-us/library/zsfww439(v=vs.80).aspx[^]

http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.classinterfaceattribute(v=vs.80).aspx[^]
When you constuct COM interfases you can use them adding reference to your library.

About using COM
Introduction to COM - What It Is and How to Use It.[^]

http://msdn.microsoft.com/en-us/library/ms173184.[^]

http://msdn.microsoft.com/en-us/library/c3fd4a20.aspx[^]


这篇关于如何在Visual Studio VC ++控制台应用程序中添加dll文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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