什么是托管的DLL的生命周期一旦它被pInovked从管理code? [英] What's the lifetime of an unmanaged DLL once it's been pInovked from managed code?

查看:172
本文介绍了什么是托管的DLL的生命周期一旦它被pInovked从管理code?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

例如,如果你有一个简单的管理控制台应用程序和一个简单的非托管C ++ DLL。您的PInvoke成C ++的DLL函数,确实不受控过程,直至表示进程中加载​​的DLL停留下来?抑或是DLL获得在完成每次的PInvoke调用卸载?

For example if you have a simple managed console app and a simple unmanaged C++ DLL. You pInvoke into a function in the C++ DLL, does the DLL stay loaded in the unmanaged process until said process comes down? Or does the DLL get unloaded at the completion of every pInvoke call?

推荐答案

它保留在内存中,除非你明确地告诉它卸载。

It stays in memory unless you explicity tell it to unload.

这篇关于什么是托管的DLL的生命周期一旦它被pInovked从管理code?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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