什么是托管dll,我们如何在本机c ++中使用它 [英] what is managed dll,how we use this in our native c++

查看:87
本文介绍了什么是托管dll,我们如何在本机c ++中使用它的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好.
谁能帮我.
什么是受管理的dll.如何在本机c ++代码中使用它?

hii all.
can any one help me.
what is managed dll.how it is used in native c++ code

推荐答案

本文可能对您有帮助
管理dll [
This article may help you
Manage dll[^]


我担心,如果您不知道所管理的是什么,我的答案很难帮你.另外,如果您不知道任何线索,那么第二个问题为时过早:如果不尝试在非托管代码中使用托管DLL,那么在真正适应托管和非托管之前,您几乎无法理解任何答案(反之亦然更容易,但到目前为止仍然不算微不足道).好的,托管DLL是为.NET平台编写的库.在.NET上,没有与Windows DLL完全相同的真正DLL和EXE.对于.NET,这只是常见的文件扩展名,其中DLL被用作库.从根本上讲,.NET中的可执行文件形成了一种称为程序集的程序集,它们在开发和运行时也会相互使用.由于基于垃圾收集的内存管理,因此将代码称为托管".现在好些了吗?

同样,仅将所有这些视为一组关键字;您将需要进行搜索,并在每个概念上花费大量时间.学习.NET就像是学习另一种非常不同类型的操作系统以及一种概念上新的语言一样.

现在,在本机C ++代码中使用…

众所周知,这是不可能的,或者只能通过COM实现.另一种方法是使用称为C ++/CLI的新C ++方言(实际上,这种语言是ECMA标准).
这是另一种解决方案(基于标准).请参阅我对这个问题的答案:
在MFC中加载C#DLL [ ^ ].

—SA
I''m afraid, if you don''t know what''s managed, my Answer can hardly help you. Also, if you have no clue, your second Question is premature: you will hardly understand any Answers before you''re really comfortable with both managed and unmanaged without trying to use managed DLL in unmanaged code (the other way around is much, much easier but still by far not trivial). OK, managed DLL is the library written for .NET platform. On .NET, there are no really DLLs and EXE in exact same sense as Windows DLLs. For .NET this is just common file name extensions, with DLLs used as libraries. More fundamentally, executables in .NET form something called assemblies which use each other during development and run-time as well. The code is called managed because of memory managements based on Garbage Collection. Better now?

Again, consider all this only as a set of key words; you would need to do your search and spend a lot of time on each concept. Learning .NET is something like learning yes another operating systems of a very different type plus a conceptually new language.

Now, using in native C++ code…

It is a know notion that this is not possible, or only possible via COM. Another way is using the new C++ dialect called C++/CLI (actually this language is the ECMA standard).
This is one more solution (based on standards). Please see my Answer to this Question: loading C# DLL in MFC[^].

—SA


这篇关于什么是托管dll,我们如何在本机c ++中使用它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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