使用VC6或者VS2005创建mfc activeX的程序,在这个ocx里我需要调用GDI+来进行绘图。
但是在编译的时候会一直卡在注册那里,如下:
Generating Code...
Linking...
   Creating library Debug/OCXLib111.lib and object Debug/OCXLib111.exp
OCXLib111.exp : warning LNK4070: /OUT:OCXLIB.OCX directive in .EXP differs from output filename "OCXLib111.ocx"; ignoring directive
Registering ActiveX Control...排查一下代码,使用GDI+时,我在stdafx.h里加入了必要的GDI+头文件:#include <comdef.h>//初始化一下com口
 #ifndef ULONG_PTR
 #define ULONG_PTR unsigned long*
#include "GdiPlus.h"
using namespace Gdiplus;
 #endif
#pragma comment(lib,"gdiplus.lib")但是问题就出在这里,using namespace Gdiplus;这句话加入编译能过,但是会出现卡在Registering ActiveX Control...这里,如果不加入using namespace Gdiplus;编译则过不去。2005和vc6我都试过了,全是这个问题。