ocx Exitinstance GdiplusShutdown ActiveX gdi+问
来源:互联网 发布:知而谨之 编辑:程序博客网 时间:2024/05/23 18:14
在vc加入gdi+时在app::Exitinstance 调用GdiplusShutdown函数会出现卡死现象,如注册控件时候regsvr32卡死,运行控件退出时卡死/挂上.解决这个更文字在于,在其他地方初始化gdi+和清除gdi+,如框架构造和析构函数实现
但是如果是在Activex中则需要改变。
GdiplusStartup 和GdiplusShutdown不能在dllmain中被调用,因为activex中的App类的Initinstance是在dllmain中被调用的,因此也不能在activex app类中的initinstance中调用,否则可能会导致死锁。
解决办法
msdn:
1 Require your clients to call GdiplusStartup before they call the functions in your DLL and to call GdiplusShutdown when they have finished using your DLL.
2 Export your own startup function that calls GdiplusStartup and your own shutdown function that calls GdiplusShutdown. Require your clients to call your startup function before they call other functions in your DLL and to call your shutdown function when they have finished using your DLL.
3 Call GdiplusStartup and GdiplusShutdown in each of your functions that make GDI+ calls.
另:这个帖子中有相关的讨论
http://topic.csdn.net/u/20111005/16/d353c25a-b269-4ecb-8a6b-c1af2341d7f1.html
- ocx Exitinstance GdiplusShutdown ActiveX gdi+问
- activeX/ocx
- ActiveX ocx
- MFC Activex OCX接口
- Activex、OLE、COM、OCX、DLL
- MFC ActiveX (OCX) 创建技术
- ocx ACTIVEX 界面相互挡住
- COM组件、ActiveX、OCX区别
- CWinThread::ExitInstance
- COM高级应用-ActiveX控件(OCX) 小记
- ocx dll activex com ole介绍
- js调用ActiveX(ocx)控件方法
- VB自定义控件的制作,ACTIVEX,.OCX
- 如何制作简易ActiveX控件(.ocx)
- ocx dll activex com ole介绍
- MFC ActiveX OCX控件添加安全接口
- activex ocx插入、调用dialog对话框
- mfc activex ocx控件内嵌窗体
- JSP中四种传递参数的方法
- Java压缩技术(四) GZIP——Java原生实现
- Goldengate添加字段等操作同步实验
- GraphSharp 简介一
- struts2 文件上传
- ocx Exitinstance GdiplusShutdown ActiveX gdi+问
- SQLBindParameter
- 有用的代码
- 输入金额代码
- Oracle数据备份命令
- 软件消费观念上的偏差
- 利用SecureCrt实现win7和vmware下ubuntu通信
- tomcat3.1的一个漏洞
- 类方法、实例方法、静态方法(重要)