BOOL CSDIOutlookView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
//  the CREATESTRUCT cs return CView::PreCreateWindow(cs);
}
(CREATESTRUCT& cs)
我也知道是传参数,但具体到底是什么来由,不清楚

解决方案 »

  1.   

    The CREATESTRUCT structure defines the initialization parameters passed to the window procedure of an application. typedef struct tagCREATESTRUCT {
       LPVOID lpCreateParams;
       HANDLE hInstance;
       HMENU hMenu;
       HWND hwndParent;
       int cy;
       int cx;
       int y;
       int x;
       LONG style;
       LPCSTR lpszName;
       LPCSTR lpszClass;
       DWORD dwExStyle;
    } CREATESTRUCT;
    Parameters
    lpCreateParams 
    Points to data to be used to create the window. 
    hInstance 
    Identifies the module-instance handle of the module that owns the new window. 
    hMenu 
    Identifies the menu to be used by the new window. If a child window, contains the integer ID. 
    hwndParent 
    Identifies the window that owns the new window. This member is NULL if the new window is a top-level window. 
    cy 
    Specifies the height of the new window. 
    cx 
    Specifies the width of the new window. 

    Specifies the y-coordinate of the upper left corner of the new window. Coordinates are relative to the parent window if the new window is a child window; otherwise coordinates are relative to the screen origin. 

    Specifies the x-coordinate of the upper left corner of the new window. Coordinates are relative to the parent window if the new window is a child window; otherwise coordinates are relative to the screen origin. 
    style 
    Specifies the new window's style. 
    lpszName 
    Points to a null-terminated string that specifies the new window's name. 
    lpszClass 
    Points to a null-terminated string that specifies the new window's Windows class name (a WNDCLASS structure; for more information, see the Platform SDK). 
    dwExStyle 
    Specifies the extended style for the new window. 
    See Also
      

  2.   

    CREATESTRUCT& cs为什么要&,一直搞不懂
      

  3.   

    初始化话窗口的一些信息设置.比如你spy++中看到的主窗口类名就是 CREATESTRUCT 中的LPCSTR lpszClass;
      

  4.   

    & cs为什么要&,一直搞不懂
    ------------------------------------------------------------
    说明cs是CREATESTRUCT类型的引用。
      

  5.   

    CWnd::PreCreateWindow
    virtual BOOL PreCreateWindow( CREATESTRUCT& cs );因为上面你的主调函数PreCreateWindow()需要这样一个参数,MSDN中规定需要给这个PreCreateWindow()函数传递一个CREATESTRUCT&类型的参数
      

  6.   

    看下Hierarchy Chart就知道上面你使用了CView::PreCreateWindow()
    而CView类是从CWnd类派生出来的