NX二次开发CreateDialog函数在UI.hxx文件和WinUser.h中的冲突【转载】

文章出自https://blog.csdn.net/qq_41843732/article/details/91422764

在UG二次开发中,若使用MFC库,一旦加上#include<Afx.h>头文件,下面这句话就报错

theDialog = GetPoints::theUI->CreateDialog(theDlxFileName);

解决CreateDialog函数在UI.hxx文件和WinUser.h中的冲突

 在windows API中已经将CreateDialog定义为宏 CreateDialogW,如下图WinUser.h中

 当编译到UI.hxx中时,CreateDialog函数背当作CreateDialogW函数,从而产生矛盾

 解决方法是在UI.hxx中加上一句 #undef CreateDialog,意为取消CreateDialog的宏定义

猜你喜欢

转载自www.cnblogs.com/nxopen2018/p/11811708.html