什么是托管的DLL的生命周期一旦它被pInovked从管理code?生命周期、DLL、code、pInovked

2023-09-08 08:41:28 作者:共饮烈酒

例如,如果你有一个简单的管理控制台应用程序和一个简单的非托管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.