工程是用win32建立的,想在里面调用MFC的类函数,如CBitmapButton。该如何做?已经做了修改:Project-Setting-General-Use MFC in a Share DLLStdAfx.h 包含了如下语句:
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions#if defined(_WIN32_WCE) && (_WIN32_WCE >= 211) && (_AFXDLL)
#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
#endif#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h> // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT程序编译没问题,但是启动的时候会报错
why?
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions#if defined(_WIN32_WCE) && (_WIN32_WCE >= 211) && (_AFXDLL)
#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
#endif#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h> // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT程序编译没问题,但是启动的时候会报错
why?
添加#define VC_EXTRALEAN
#include <afxwin.h>
#include <afxext.h>
#include <afxdisp.h>
#include <afxdtctl.h>
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h>
#endif
要是启动出错,可以设置个断点,调试看看什么地方出错~~~
因为#include <afxwin.h>已经包含了~~~