Note that you should never, ever return FALSE from DllMain. The reason is that if you are
using implicit dynamic linking, what this does is cause the entire app to fail to load.
What this does is generate a tech support call with the only available information "It
didn't load", which is a Really Bad Idea. What I do is set a flag that indicates there is
a failure in DLL loading, and then later I can decide what to do (for example, all the
interfaces return an error code to indicate that initialization failed). This allows me
to give meaningful results to the user when there is a failure. 关键第一句
using implicit dynamic linking, what this does is cause the entire app to fail to load.
What this does is generate a tech support call with the only available information "It
didn't load", which is a Really Bad Idea. What I do is set a flag that indicates there is
a failure in DLL loading, and then later I can decide what to do (for example, all the
interfaces return an error code to indicate that initialization failed). This allows me
to give meaningful results to the user when there is a failure. 关键第一句
解决方案 »
- 求教:MFC中可以实现LIB与EXE间资源切换吗?
- visual stdio 2005里面的vc与visual c 6.0有区别没有
- 把一个小数指定位数Format的问题
- 一个MFC界面程序的奇怪问题
- 线程 执行 主函数 的问题?
- 在CFormView里自带的SB_HORZ的一点问题
- 方法中要返回一个接口,我怎样才能把这个接口赋上值呢? 在服务端,怎样用 QueryInterface() 呢?
- 困惑,大家来聊聊。
- 还是最大化的问题
- VC里char a[]="A48dEh",怎样转为 char b[]={0xa4,0x8d,0xeh}?
- 函数传递数组首地址的问题请教:
- 怎么获取要使用的字体(API)
那么,假如不使用隐式链接,可以直接在DllMain中返回FALSE么?
顺便问下,有啥好方法让Dll自己卸载自己?