#define MYEDIT 2343
..................
CEdit* tempEdit ; tempEdit=new CEdit();
ASSERT_VALID(tempEdit);
if(tempEdit->Create(ES_RIGHT|WS_VISIBLE|WS_CHILD,CRect(0,0,30,50),this,MYEDIT)==0)
MessageBox("creat false");
..................结果总是报告出错
..................
CEdit* tempEdit ; tempEdit=new CEdit();
ASSERT_VALID(tempEdit);
if(tempEdit->Create(ES_RIGHT|WS_VISIBLE|WS_CHILD,CRect(0,0,30,50),this,MYEDIT)==0)
MessageBox("creat false");
..................结果总是报告出错
解决方案 »
- detected memory leaks怎么处理,很多内存块泄露怎么办
- 网络编程中的灵异事件,希望高人指点
- 大家帮一下忙,我画了一个软件效果图,不过我想在VC里面应用.
- 怎么设置登录对话框为启动对话框,刚学vc,谢谢!
- 明天去面试VC程序员,但我是新手,怎办?
- 关于菜单问题?
- 请问如何获取控件LIST CONTROL上的坐标?
- 如何改变CWnd的背景颜色(高手们请帮忙)
- 假如有一个表,有两个字段(NAME,COUNT)里面有很多的记录,其中NAME字段相同,但COUNT字段不相同,有没有什么SQL语句可以把这些记录合
- win2000 里如何隐藏鼠标
- 请问如何清除CAsyncSocket的接收缓冲区..
- 请问如何改变CListCtrl的风格?
会出错
如果不在构造函数:是可以的
pEdit->Create(WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_BORDER, CRect(10, 10, 100, 100), this, 1);
真烦,太奇怪了
{
// Construction
public:
CEdit* tempEdit;
CButton* tempButton;
bool m_fnInitiatInputFrame(); ///在此函数中加入生成控件的代码
CRequestInput(CWnd* pParent = NULL); // standard constructor// Dialog Data
//{{AFX_DATA(CRequestInput)
enum { IDD = IDD_INPUTREQUEST };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CRequestInput)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL// Implementation
protected: // Generated message map functions
//{{AFX_MSG(CRequestInput)
// NOTE: the ClassWizard will add member functions here
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.#endif // !defined(AFX_REQUESTINPUT_H__D1F5BC62_DECC_4A03_8115_496695BD1492__INCLUDED_)
/////////////////////cpp文件
// RequestInput.cpp : implementation file
//#include "stdafx.h"
#include "SDIMulViewB.h"
#include "RequestInput.h"#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif/////////////////////////////////////////////////////////////////////////////
// CRequestInput dialog
CRequestInput::CRequestInput(CWnd* pParent /*=NULL*/)
: CDialog(CRequestInput::IDD, pParent)
{
//{{AFX_DATA_INIT(CRequestInput)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CRequestInput::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CRequestInput)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CRequestInput, CDialog)
//{{AFX_MSG_MAP(CRequestInput)
// NOTE: the ClassWizard will add message map macros here
//}}AFX_MSG_MAP
END_MESSAGE_MAP()/////////////////////////////////////////////////////////////////////////////
// 我的调试代码bool CRequestInput::m_fnInitiatInputFrame()
{
UINT temp(1234);
UINT temp2(1233);
int error;
CString str;
//temp=1278; tempEdit=new CEdit();
ASSERT_VALID(tempEdit);
if(tempEdit->Create(1,CRect(0,0,30,50),this,MYBUTTON)==0) //////不能成功
MessageBox("false");
tempButton=new CButton();
ASSERT_VALID(tempButton);
if(tempButton->Create("Button Title ",
WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON, //////创建按钮也不能成功
CRect(40,50,100,24),
this,
temp2)==0)
MessageBox("Buttonfalse");
return true;
}