其它的如OnSize(),PreCreatWindow都能响应,但是OnInitialUpdate()怎么不响应?高手指教.

解决方案 »

  1.   

    void CHQBJ_form::OnInitialUpdate() 
    {
    CFormView::OnInitialUpdate();

    // TODO: Add your specialized code here and/or call the base class

             int i = 1; }
    void CHQBJ_form::OnSize(UINT nType, int cx, int cy) 
    {
    CFormView::OnSize(nType, cx, cy);

    // TODO: Add your message handler code here
    RECT rect;
    GetClientRect(&rect);
    CMSFlexGrid *grid = (CMSFlexGrid *)GetDlgItem(IDC_QUOTE_GRID);
    if (grid)
    grid->MoveWindow(&rect);
    }
      

  2.   

    在OnInitialUpdate()中设一个断点,看看能不能跟踪进去.
      

  3.   

    class CHQBJ_form : public CFormView
    {
    protected:
    CHQBJ_form();           // protected constructor used by dynamic creation
    DECLARE_DYNCREATE(CHQBJ_form)// Form Data
    public:
    //{{AFX_DATA(CHQBJ_form)
    enum { IDD = IDD_HQBJ_FORM };
    CMSFlexGrid m;
    //}}AFX_DATA// Attributes
    public:// Operations
    public:

    // Overrides
    // ClassWizard generated virtual function overrides
    //{{AFX_VIRTUAL(CHQBJ_form)
    public:
    virtual void OnInitialUpdate();
    virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
    protected:
    virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
    //}}AFX_VIRTUAL// Implementation
    protected:
    virtual ~CHQBJ_form();
    #ifdef _DEBUG
    virtual void AssertValid() const;
    virtual void Dump(CDumpContext& dc) const;
    #endif // Generated message map functions
    //{{AFX_MSG(CHQBJ_form)
    afx_msg void OnSize(UINT nType, int cx, int cy);
    afx_msg void OnMouseUpQuoteGrid(short Button, short Shift, long x, long y);
    afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
    DECLARE_EVENTSINK_MAP()
    //}}AFX_MSG
    DECLARE_MESSAGE_MAP()
    };///////////////////////////////////////////////////////////////////////////////{{AFX_INSERT_LOCATION}}
    // Microsoft Visual C++ will insert additional declarations immediately before the previous line.#endif // !defined(AFX_HQBJ_FORM_H__45CB608F_B365_4CCE_87C9_00E9ADB6355A__INCLUDED_)
      

  4.   

    关于“一个对话框从CFormView派生,为什么它不响应自己的OnInitialUpdate()?其它的能响应”代码已经贴出,我设了断点就是不进去?为什么?