MFC ACTIVEX开发的一个控件,为什么调用gdiplusshutdown这个的时候,我的程序在注册控件的时候,停止了,死到那里,注册不上!
解决方案 »
- 50分求助,分不多,求帮忙!
- 问一个C++基础问题,谢谢
- UCHAR类型如何转成CString类型
- 老大们 请问如何把纯文本表格中的内容保存为word格式文件(我只有二十分了)
- 提问:如何象NT任务管理器那样得到进程占用内存的大小?在WINCE下又该如何做?回答任何问题都可以,来者有分。
- 我做了一个软件下载的程序,如何计算下载时的速率呢??
- 我的CSocket怎么连接错误?不应该呀?
- 关于绘图:为什么只有OnDraw()中的内容能绘出,在其它地方绘制的图形不显示??
- 我们在写Win32程序的时候,平台之间的差异对程序的影响有哪些,主要要注意哪些?
- 我写了个小程序,如何上载呢
- 求解一个内部局域网与外网通讯的问题
- 怎么让多文档视图的背景变成黑色啊?万分感谢!
参考http://msdn2.microsoft.com/en-us/library/ms534077(VS.85).aspx
注册成了,但是CMD窗体停止了.用REGSVR32注册的话提示成功了,但REGSVR32在后面
还在运行.
[out] Pointer to a ULONG_PTR that receives a token. Pass the token to GdiplusShutdown when you have finished using GDI+.
指向用来接收token(记号)的ULONG_PTR.当结束使用GDI+时将这个token(记号)传入GdiplusShutdown.
input
[in] Pointer to a GdiplusStartupInput structure that contains the GDI+ version, a pointer to a debug callback function, a Boolean value that specifies whether to suppress the background thread, and a Boolean value that specifies whether to suppress external image codecs.
指向包含GDI+版本,一个调试回调函数指针,一个指示是否禁用后台线程布尔值和一个指示是否禁用外部图像编解码器的布尔值的GdiplusStartupInput结构,
output
[out] Pointer to a GdiplusStartupOutput structure that receives a pointer to a notification hook function and a pointer to a notification unhook function. If the SuppressBackgroundThread data member of the input parameter is FALSE, then this parameter can be NULL.
指向一个接收通知挂钩(钩子)函数的指针和一个通知解除挂钩(钩子)函数的指针.如果输入参数中禁用后台线程数据成员(即SuppressBackgroundThread)值为FALSE,这个参数(output)可以设置为NULL.Return Values返回值If the function succeeds, it returns Ok, which is an element of the Status enumeration.如果函数成功,返回OK(枚举Status中的一项).If the function fails, it returns one of the other elements of the Status enumeration.如果函数执行失败将返回枚举Status中的任一其它项.
Res注:You must call GdiplusStartup before you create any GDI+ objects, and you must delete all of your GDI+ objects (or have them go out of scope) before you call GdiplusShutdown.在你创建任何GDI+对象前必须首先调用GdiplusStartup,而且在你调用GdiplusShutdown之前删除完(或..理解不了)所有你所创建所有GDI+对象.You can call GdiplusStartup on one thread and call GdiplusShutdown on another thread as long as you delete all of your GDI+ objects (or have them go out of scope) before you call GdiplusShutdown.你可以在一个线程调用GdiplusStartup,并用可以在另一个线程调用GdiplusShutdown,只要你在调用GdiplusShutdown前删除了所有你创建的GDI+对象(或......).Do not call GdiplusStartup or GdiplusShutdown in DllMain or in any function that is called by DllMain. If you want to create a DLL that uses GDI+, you should use one of the following techniques to initialize GDI+:切勿在DLLMAIN或任何由DLLMAIN调用的函数中调用GdiplusStartup或GdiplusShutdown( 真TMD难理解,一层又一层-_-!!).如果你想创建一个使用GDI+的DLL(动态链接库),你应该使用其下的任一方法来初始化GDI+. * 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.
* 命令你的客户机程序(执行程序)在调用DLL中的函数前先调用GdiplusStartup,在结束使用DLL时调用GdiplusShutDown.
* 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.
* 输出自定义的调用GdiplusStartup的启动函数和调用GdiplusShutdown的关闭函数.命令你的客户机程序在调用DLL中的函数前调用自定义启动函数,在结束使用DLL时调用自定义的关闭函数.
* Call GdiplusStartup and GdiplusShutdown in each of your functions that make GDI+ calls.
* 在每个进行GDI+调用的函数中调用GdiplusStartup和GdiplusShutdown. Example Code [C++]示例代码[C++]For an example of calling GdiplusStartup and GdiplusShutdown in a Windows application, see Getting Started.请在Getting Started中查看关于在窗口程序中调用GdiplusStartup和GdiplusShutdown的示例.(很可惜我没能找到这个示例,相关示例请查看"在VC6中使用GDI+".The following console application uses a GDI+ Image object to retrieve the width and height of a JPEG image. The code calls GdiplusStartup before creating the Image object and calls GdiplusShutdown before terminating. Note that the Image object is deleted before the call to GdiplusShutdown.下列控制台程序使用GDI+的Image对象接收JPEG图像的宽和高.代码在创建Image对象前调用GdiplusStartup,在终结前调用GdiplusShutdown.注意Image对象在调用GdiplusShutdown前被删除.In the following code, the variable gdiplusStartupInput is initialized by the default constructor of the GdiplusStartupInput structure. The default constructor sets the data members of the structure to the following values:下列代码中,变量gdiplusStartupInput由GdiplusStartupInput结构的默认构造函数(?)初始化.默认构造函数将结构中的数据成员值进行如下设置: * GdiplusVersion = 1
* DebugEventCallback = NULL
* SuppressBackgroundThread = FALSE
* SuppressExternalCodecs = FALSE #include <windows.h>#include <gdiplus.h>#include <stdio.h>using namespace Gdiplus;INT main(){ Gdip