若A.exe静态链接B.dll,B.dll使用static HMODULE hDLL = ::LoadLibrary("C.dll");加载C.dll,则若C.dll加载失败,则A.exe出现"应用程序正常初始化(0xC0000005)失败.请单击"确定",终止应用程序."
为避免 static HMODULE hRenderCraftDLL = ::LoadLibrary("C.dll");在程序一启动就运行加载,将其改为
inline static HMODULE GetRenderCraftDLL()
{
static HMODULE hRenderCraftDLL = ::LoadLibrary("RenderCraft.dll");
return hRenderCraftDLL;
}
用函数来实现延迟加载的技巧.