我在做的界面右面有一个工具栏,派生自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函数,它后面带的参数我都查不到。请诸位高手帮帮忙。
解决方案 »
- Receive和recvfrom?
- 弱弱地问一下:有关串口通信的
- 为什么微软不推荐使用WritePrivateProfileString?
- 各位救命啊!
- 定义可自由跳出的代码块(欢迎讨论指正批评或在共和国允许的情况下骂娘)
- 加载鼠标资源的过程中出现的问题.
- 请教大虾一个关于CSocket 问题
- 为什么我的钩子只有在焦点在我的程序上才捕捉消息?
- GetCursorPos()怎么用呢?
- wistaria兄,我已经下载完了MSDN2.ZIP和MSDN3.ZIP,谢谢,可是有个问题要请教
- 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
}
...
}