在我的工程中,当我在ClassWizard中选中类,CGenWorkareaDlg时便出现如下提示:
A duplicate insert block exists for class "CGenWorkareaDlg" in the source files(E:\wzg\vc\bxs\GenWorkareaDlg.h,E:\wzg\vc\bxs\GenWorkareaDlg.cpp),并且不能选中CGenWorkareaDlg。请问这是为什么?
解决方案 »
- SDK 子窗口 父窗口 消息
- 请求好方法,在线等待...
- 如何实现每个子窗口都在任务栏占用一个位置,像IE一样???
- 请问在发送方发过来的数据长度大于,我缓冲区一次能读取的数据量,是不是可以循环读取?
- 怎么找不到graphics.h??
- 开始想学C++了,但是...
- 怎样往External Dependencies中添加文件呢?!急……Thank you!^-^
- 急!!!!在线等!!!!!!!!!!!!!!!!!!!这个错误是什么意思?该怎么办?
- 为什么Hello World都需要VC运行库的支持?
- MFC单文档程序,如何让菜单的大小变大一点
- 关于LVITEM结构的使用
- 如何获取IE临时文件目录中的文件
让wizard
重新扫描一下
#if !defined(AFX_GENWORKAREADLG_H__6373A330_95F6_44E8_8621_CA155D90491D__INCLUDED_)
#define AFX_GENWORKAREADLG_H__6373A330_95F6_44E8_8621_CA155D90491D__INCLUDED_#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// GenWorkareaDlg.h : header file
//
#include "SortListCtrl.h"
#include "WBButton.h" //加入位图按钮类/////////////////////////////////////////////////////////////////////////////
// CGenWorkareaDlg dialogclass CGenWorkareaDlg : public CDialog
{
// Construction
public:
CGenWorkareaDlg(LPCTSTR lpszTemplateName, CWnd* pParent = NULL);
CGenWorkareaDlg(UINT nIDTemplate, CWnd* pParent = NULL); // standard constructor// Dialog Data
CBrush m_Brush; //{{AFX_DATA(CGenWorkareaDlg)
// enum { IDD = IDD_GENWORKAREADLG };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CGenWorkareaDlg)
public:
virtual BOOL PreTranslateMessage(MSG* pMsg);
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
virtual void OnOK( );
//}}AFX_VIRTUAL// Implementation
protected: // Generated message map functions
//{{AFX_MSG(CGenWorkareaDlg)
afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.#endif // !defined(AFX_GENWORKAREADLG_H__6373A330_95F6_44E8_8621_CA155D90491D__INCLUDED_)
文件GenWorkareaDlg.cpp:
// GenWorkareaDlg.cpp : implementation file
//#include "stdafx.h"
#include "bxs.h"
#include "GenWorkareaDlg.h"
#include "ChildView.h"
#include "MainFrm.h"#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif/////////////////////////////////////////////////////////////////////////////
// CGenWorkareaDlg dialog
CGenWorkareaDlg::CGenWorkareaDlg(UINT nIDTemplate, CWnd* pParent /*=NULL*/)
: CDialog(nIDTemplate, pParent)
{
//{{AFX_DATA_INIT(CGenWorkareaDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
m_Brush.CreateSolidBrush( WORKAREA_COLOR );
}CGenWorkareaDlg::CGenWorkareaDlg(LPCTSTR lpszTemplateName, CWnd* pParent /*=NULL*/)
: CDialog(lpszTemplateName, pParent)
{
//{{AFX_DATA_INIT(CGenWorkareaDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
m_Brush.CreateSolidBrush( WORKAREA_COLOR );
}
void CGenWorkareaDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CGenWorkareaDlg)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CGenWorkareaDlg, CDialog)
//{{AFX_MSG_MAP(CGenWorkareaDlg)
ON_WM_CTLCOLOR()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()/////////////////////////////////////////////////////////////////////////////
// CGenWorkareaDlg message handlersHBRUSH CGenWorkareaDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
pDC->SetBkMode(TRANSPARENT);
if( nCtlColor == CTLCOLOR_DLG || nCtlColor == CTLCOLOR_STATIC )
{
return m_Brush;
} return hbr;
}void CGenWorkareaDlg::OnOK()
{
}
BOOL CGenWorkareaDlg::PreTranslateMessage(MSG* pMsg)
{
// TODO: Add your specialized code here and/or call the base class
if (pMsg->message == WM_KEYDOWN)
{
if(pMsg->wParam==VK_ESCAPE)
{
//MessageBox("ESC键");
return TRUE;
}
}
return CDialog::PreTranslateMessage(pMsg);
}