从 MFC 程序中卸载 dll 文件
我有一个 MFC 程序,即使我关闭该程序,它也不会消失,并且仍然显示在任务管理器中。当我查看调用堆栈时,我发现一些 dll 文件仅加载但未卸载。
有没有办法让程序退出时卸载所有dll文件?所以exe不会显示在任务管理器中。
我在类的顶部声明了一些变量:
vtkPoints *newPts = vtkPoints::New();
vtkPoints *newPtsSuction = vtkPoints::New();
CArray <double,double> ScalarValues_pressure;
CArray <double,double> ScalarValues_suction;
CArray <double,double> ScalarValues;
并在另一个函数中将值添加到它们中,并直接在另一个函数中使用这些变量。
I have a MFC program that even I close the program it does not get away and still shown in the task manager. When I look at the call stack I saw that some dll files are only loaded but not unloaded.
Is thee a way to make all the dll files unloaded when exit the program? So the exe will not be shown in the task manager.
I have declared some variables at top of the class:
vtkPoints *newPts = vtkPoints::New();
vtkPoints *newPtsSuction = vtkPoints::New();
CArray <double,double> ScalarValues_pressure;
CArray <double,double> ScalarValues_suction;
CArray <double,double> ScalarValues;
And add the values to them in another function and use the variables directly in another function.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先的问题不是 DLL 卸载。您的应用程序冻结在某种死循环中,或者无法正确完成终止。修复此问题后,库将自动卸载,并且进程将继续,包括从任务列表中卸载。
The problem in first place is not DLL unloading. Your application freezes in a sort of dead loop or otherwise does not complete the termination properly. Having this fixed, the libraries will be unloaded automatically and the process will go, including from the task list.