Udostępnij za pośrednictwem


CFrameWnd::LoadFrame

Call to dynamically create a frame window from resource information.

virtual BOOL LoadFrame(
   UINT nIDResource,
   DWORD dwDefaultStyle = WS_OVERLAPPEDWINDOW | FWS_ADDTOTITLE,
   CWnd* pParentWnd = NULL,
   CCreateContext* pContext = NULL 
);

Parameters

  • nIDResource
    The ID of shared resources associated with the frame window.

  • dwDefaultStyle
    The frame's style. Include the FWS_ADDTOTITLE style if you want the title bar to automatically display the name of the document represented in the window.

  • pParentWnd
    A pointer to the frame's parent.

  • pContext
    A pointer to a CCreateContext structure. This parameter can be NULL.

Remarks

Construct a CFrameWnd object in two steps. First, invoke the constructor, which constructs the CFrameWnd object, and then call LoadFrame, which loads the Windows frame window and associated resources and attaches the frame window to the CFrameWnd object. The nIDResource parameter specifies the menu, the accelerator table, the icon, and the string resource of the title for the frame window.

Use the Create member function rather than LoadFrame when you want to specify all of the frame window's creation parameters.

The framework calls LoadFrame when it creates a frame window using a document template object.

The framework uses the pContext argument to specify the objects to be connected to the frame window, including any contained view objects. You can set the pContext argument to NULL when you call LoadFrame.

Requirements

Header: afxwin.h

See Also

Reference

CFrameWnd Class

Hierarchy Chart

CDocTemplate Class

CFrameWnd::Create

CFrameWnd::CFrameWnd

CWnd::PreCreateWindow

Other Resources

CFrameWnd Members