正在加载图片...
LPCTSTR lpWindowName, / window name dWord dwStyle, //window style int x, / horizontal position of window int y, / vertical position of window int nWidth,// window width int nHeight, // window height HWND hWndParent, / handle to parent or owner window HMENU hMenu, / menu handle or child identifier HINSTANCE hInstance, / handle to application instance LPVOID lpParam //window-creation data 使用这个API函数,我们可以创建各种窗口。 CWnd封装的函数: virtual BOOL CWnd:: Create LPCTSTR lpsz ClassName LPCTSTR IpszwindowName dWord dwStyle const recT& rect, CWnd* pParentWnd UINT nID CCreateContext* cOntext NULL 不用我说,你也能看出这仍然是个改改参数的蹩脚的封装。我们不去管它,现在我们关 心的是:CWnd:: Create对 CreateWindow进行了封装,可是这一封装的结果是:原来 CreateWindow能实现的一些事情,在CWnd: create里突然成了例外。是的,为了适应 CWnd 在MFC架构中所处的角色,程序员在涉及CWnd时必须记忆这样一条例外LPCTSTR lpWindowName, // window name DWORD dwStyle, // window style int x, // horizontal position of window int y, // vertical position of window int nWidth, // window width int nHeight, // window height HWND hWndParent, // handle to parent or owner window HMENU hMenu, // menu handle or child identifier HINSTANCE hInstance, // handle to application instance LPVOID lpParam // window-creation data ); 使用这个 API 函数,我们可以创建各种窗口。 CWnd 封装的函数: virtual BOOL CWnd::Create ( LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL ); 不用我说,你也能看出这仍然是个改改参数的蹩脚的封装。我们不去管它,现在我们关 心的是:CWnd::Create 对 CreateWindow 进行了封装,可是这一封装的结果是:原来 CreateWindow 能实现的一些事情,在 CWnd::Create 里突然成了例外。是的,为了适应 CWnd 在 MFC 架构中所处的角色,程序员在涉及 CWnd 时必须记忆这样一条例外:
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有