有关FreeLibrary的问题 [英] A question about FreeLibrary

查看:265
本文介绍了有关FreeLibrary的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HMODULE hModule  = ::LoadLibrary("GameLogicWZQ.dll");
typedef GameObject* (*CreateObjProc)();
CreateObjProc pCreateProc = (CreateObjProc)::GetProcAddress(hModule,"CreateGameObject");
m_pGameObject = pCreateProc();
::FreeLibrary(hModule);



如果pCreateProc()函数分配的缓冲区大小为1024(使用new),那么在调用::FreeLibrary(hModule)之后,该缓冲区将是空闲的吗?



If the pCreateProc() function allocates a buffer size of 1024 (using new), then after calling ::FreeLibrary(hModule), will the buffer be free?

推荐答案

否,它惯于.应该从释放该内存的DLL中导出相应的功能.可以调用此函数(与调用Create函数相同).
No, it won''t. A corresponding function should be exported from the DLL that frees that memory. And this function could be called (the same way the Create function is called).


这篇关于有关FreeLibrary的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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