用VS2010的Dialog资源添加类,提示错误。1、新建一个Dialog资源,ID标示为:IDD_DIALOG1。
2、双击“Dialog资源”对话框,为“资源”创建类“CTestDlg”,基类为“CDialog”。
3、“TestDlg.h”文件。
#pragma once
// CTestDlg dialogclass CTestDlg : public CDialog
{
DECLARE_DYNAMIC(CTestDlg)public:
CTestDlg(CWnd* pParent = NULL); // standard constructor
virtual ~CTestDlg();// Dialog Data
enum { IDD = IDD_DIALOG1 };
问题一:“IDD_DIALOG1”提示“未定义”错误,这是怎么回事???“IDD_DIALOG1”是资源ID,怎么会未定义???
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support DECLARE_MESSAGE_MAP()
};
afxver_.h中提示错误:
/////////////////////////////////////////////////////////////////////////////
// Special configurations// _AFXEXT implies _AFXDLL
#if defined(_AFXEXT) && !defined(_AFXDLL)
#define _AFXDLL
#endif#if defined(_AFXDLL) && !defined(_DLL)
#error Please use the /MD switch for _AFXDLL builds错误信息: 2 IntelliSense: #error directive: Please use the /MD switch for _AFXDLL builds c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxver_.h 81 3 问题二:为什么会出现这样的错误呢???好像经常会出现这样的错误,但是并不影响程序运行,不明白啊???
#endif/////////////////////////////////////////////////////////////////////////////
2、双击“Dialog资源”对话框,为“资源”创建类“CTestDlg”,基类为“CDialog”。
3、“TestDlg.h”文件。
#pragma once
// CTestDlg dialogclass CTestDlg : public CDialog
{
DECLARE_DYNAMIC(CTestDlg)public:
CTestDlg(CWnd* pParent = NULL); // standard constructor
virtual ~CTestDlg();// Dialog Data
enum { IDD = IDD_DIALOG1 };
问题一:“IDD_DIALOG1”提示“未定义”错误,这是怎么回事???“IDD_DIALOG1”是资源ID,怎么会未定义???
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support DECLARE_MESSAGE_MAP()
};
afxver_.h中提示错误:
/////////////////////////////////////////////////////////////////////////////
// Special configurations// _AFXEXT implies _AFXDLL
#if defined(_AFXEXT) && !defined(_AFXDLL)
#define _AFXDLL
#endif#if defined(_AFXDLL) && !defined(_DLL)
#error Please use the /MD switch for _AFXDLL builds错误信息: 2 IntelliSense: #error directive: Please use the /MD switch for _AFXDLL builds c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxver_.h 81 3 问题二:为什么会出现这样的错误呢???好像经常会出现这样的错误,但是并不影响程序运行,不明白啊???
#endif/////////////////////////////////////////////////////////////////////////////
解决方案 »
- 不用三角函数求点到线段距离的算法
- 在对话框上画图,为什么只有在被别的窗口遮挡后才能画出
- COM接口问题
- server 2003上,在一个大文件(30G左右)上进行写操作,WriteFile出现ERROR_NO_SYSTEM_RESOURCES错误!
- 到底怎样称的上是COM组件,有点晕?
- 用CCommand<CManualAccessor> 打开一个表(select * from table)后,怎么改写表中的内容(添加、修改)?
- VC遇到难题~~~大侠快来救命啊~~!!!
- 关于保存路径的问题
- 菜鸟问题,高手指点
- 在vs项目中添加菜单
- 整整3天了,我快疯了~activex问题求助
- 获取子窗口句柄的问题
问题一:“IDD_DIALOG1”提示“未定义”错误,这是怎么回事???“IDD_DIALOG1”是资源ID,怎么会未定义???
==>include "resource.h" 即可。#error Please use the /MD switch for _AFXDLL builds错误信息: 2 IntelliSense: #error directive: Please use the /MD switch for _AFXDLL builds c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxver_.h 81 3 问题二:为什么会出现这样的错误呢???好像经常会出现这样的错误,但是并不影响程序运行,不明白啊???
====================
属性 => C/C++ => Code Generation更改为/MT(MTDebug) or /MD(MDDebug)
这和你选择的Use of MFC library相关. (General => Use of MFC)
附加问题一:很奇怪,第一个错误不影响运行,“IDD_DIALOG1”提示“未定义”这个错误不提示了,但是什么都没有改啊。是不是VS2010智能感知的问题???附加问题二:属性 => C/C++ => Code Generation更改为/MT(MTDebug) or /MD(MDDebug)
这和你选择的Use of MFC library相关. (General => Use of MFC)这样操作的作用是什么???
错误:“2 IntelliSense: #error directive: Please use the /MD switch for _AFXDLL builds c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxver_.h 81 3 ”没了,但是出现了警告:
Warning 1 warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library C:\Users\Administrator.PC-20110905ONBV\Desktop\Demo\VC\Dialog\Mybole\Mybole\LINK Mybole原来默认的是“Multi-threaded Debug DLL (/MDd)”
能不能追加者问一点问题:
问题一:VC++解决方案—>右键“属性”—>“C/C++”—>“Code Generation”这是设置什么的呢???问题二:这个选项卡下“Runtime Library”的“Multi-threaded (/MT)”、“Multi-threaded Debug(/MTd)”、“Multi-threaded DLL (/MD)”、“Multi-threaded Debug DLL (/MDd)”这四项分别是什么意思呢???问题三:“Configuration:”下有“Active(Debug)、Debug、Release、AllConfigurations”四项,分别是什么意思呢???问题四:“Platform:”下有“Active(Win32)、Win32”两项,又是什么意思???
MD 多线程dll MDd 多线程调试dll
http://hi.baidu.com/summy00/blog/item/6acfd7ef6b2503e7cf1b3eae.html