我在做的界面右面有一个工具栏,派生自CDialog,是自定义的,它上面有一些单选框之类的选项按钮,在编辑资源时,它是IDD_DIALOGBAR。它的构造孙数是
CMyDialog::CMyDialog(CWnd* pParent /*=NULL*/)
: CDialog(CMyDialog::IDD, pParent)BOOL CMyDialog::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID,
CCreateContext* pContext)
{
// TODO: Add your specialized code here and/or call the base class
return CDialog::Create(IDD, pParentWnd);
}
可是我不会用它的Creat函数,它后面带的参数我都查不到。请诸位高手帮帮忙。
CMyDialog::CMyDialog(CWnd* pParent /*=NULL*/)
: CDialog(CMyDialog::IDD, pParent)BOOL CMyDialog::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID,
CCreateContext* pContext)
{
// TODO: Add your specialized code here and/or call the base class
return CDialog::Create(IDD, pParentWnd);
}
可是我不会用它的Creat函数,它后面带的参数我都查不到。请诸位高手帮帮忙。
解决方案 »
- 天啊!我一不小心写出了最简单的能显示出窗口的代码!我准备申请微软MVP!
- 关于非模式对话框的问题
- 请问如何实现在edit control中的光标处文本的插入
- 一个访问url接口的问题
- 高手,如何保证B/S、C/S两种结构的统一?
- ** 100分 **!! 请教大家一个关于操作.dbf数据表文件的很菜的问题! 急~~~~
- 用directx画底图后,在ondraw中画其他东西,底图不见,why?
- c语言中fabs是啥意思?谁有c语言的函数表?
- LoadResource不是真正将资源载入内存?
- 有一个想法,但不知道能不能实现,请帮助看一看
- 1000分求VC++,MD5,16位加密函数。
- 我在用send发送数据时出现WSAEWOULDBLOCK 错误,怎么解决啊?
创建对话框CreateDialog
The CreateDialog macro creates a modeless dialog box from a dialog box template resource. The CreateDialog macro uses the CreateDialogParam function.HWND CreateDialog(
HINSTANCE hInstance, // handle to module
LPCTSTR lpTemplate, // dialog box template name
HWND hWndParent, // handle to owner window
DLGPROC lpDialogFunc // dialog box procedure
);或者CDialog::CDialog
To construct a resource-based modal dialog box, call either public form of the constructorvirtual BOOL Create(
LPCTSTR lpszTemplateName,
CWnd* pParentWnd = NULL
);
virtual BOOL Create(
UINT nIDTemplate,
CWnd* pParentWnd = NULL
);
Parameters
lpszTemplateName
Contains a null-terminated string that is the name of a dialog-box template resource.
pParentWnd
Points to the parent window object (of type CWnd) to which the dialog object belongs. If it is NULL, the dialog object's parent window is set to the main application window.
nIDTemplate
Contains the ID number of a dialog-box template resource.
pszClassName 是创建的类名
lpszWindowName 窗口名称
dwStyle 窗口样式
rect 窗口大小
pParentWnd 父窗口句柄
nID 资源库的模板
pContext 帮助上下文
{
if (!m_DlgBar.Create(this, IDD_DIALOG1,
CBRS_RIGHT, AFX_IDW_DIALOGBAR))
{
TRACE0("Failed to create dialogbar\n");
return -1; // fail to create
}
...
}