????? ????? ????? ?????? ??????? ?? CDialogBar ???????

?????? ????????? ?????? ?????????
???? ???????: 185672 - ??? ???????? ???? ????? ????? ??? ???????.
????? ???? | ?? ????

??????

??? ????? CDialogBar ????? ??? ??? CButtons ??? ??????? ????? ?? MFC ???????? ??? ???????, ?? ??????? ?? ????? ?? CDialogBar ??? ????? CControlBar ????? ????? ??????? ?? ?? ????? ?????? ???????.

??? ???? ?? ???? ???? CDialogBar ???? ??????? ?? ???? ???? ??????? ?????? ???????? ?? treeview ?? ???? ???? ActiveX ?? ???? ?????? ????? ?? CDialogBar ?????? ????? ????? ?????? ???????.

???? ??? ?????? ClassWizard ?????? ??? ?? CDialogBar ? ???? ??? ?????? ??????? ???????? ??? ????? ??? ?? CDialog ?? "?????" ????? ??? CDialogBar.

??????? ????

???? ?????? ??? CDialog ?? ????? ?????? ??????? ???? ???? ?????????. ????? ????? ??? CDialog ?? ??? CDialogBar ???????? ??????? ???? ???????:

  1. ????? ????? ???????? ?? CDialog ??? CDialogBar ?? ????? ???. ?? ??? ????? ????? ????? ???????? ?? BEGIN_MESSAGE_MAP ?? ??? .cpp.
  2. ????? ????? ?? .h ???????? .cpp. ????? ????? ??????? DoDataExchange(). ???? ??? ????? ????? ??????.

    ????? ?? ??? ??
          CMyDlgBar (CWnd* pParent = NULL);   // standard constructor
    
          CMyDlgBar:: CMyDlgBar (CWnd* pParent /*=NULL*/)
             : CDialog(CMyDlgBar::IDD, pParent)
          {
             ...
    
          void CMyDlgBar::DoDataExchange(CDataExchange* pDX)
          {
             CDialog::DoDataExchange(pDX);
             ...
    					
    ??????:
          CMyDlgBar ();   // standard constructor
    
          CMyDlgBar:: CMyDlgBar ()
          {
             ...
    
          void CMyDlgBar::DoDataExchange(CDataExchange* pDX)
          {
             CDialogBar::DoDataExchange(pDX);
             ...
    					
    ??????? ??? ??????? ??? ????? ?????? ????? OnInitDialog() ???????? ??? ????? ??????? ???? ?? ??????? WM_INITDIALOG ?? ???? ????? ??????? OnInitDialog ??????? ????? ????? ON_MESSAGE(). ?? ?? ???? ???? ??? ????? OnInitDialog(). ??? ?? ??? ????? ????? ?? ?????? ??? ??? ????????.
  3. ????? "OnInitDialog() ????? ???????;" ?? ??? ??? ?????? "afx_msg ????? OnInitDialog (UINT ? ?????);" ?? ??????. ??? ???? ??????:
          class CMyDlgBar : public CDialogBar
          {
             ...
          // Implementation
          protected:
    
             // Generated message map functions
             //{{AFX_MSG(CMyDlgBar)
             virtual BOOL OnInitDialog();                // <-Remove this line.
             //}}AFX_MSG
    
             afx_msg LONG OnInitDialog ( UINT, LONG );   // <-Add this line.
             DECLARE_MESSAGE_MAP()
          };
    						
    ???? ? ?? ?????? ????? ??? ???? ????????? ????????.
  4. ????? "ON_MESSAGE (WM_INITDIALOG ? OnInitDialog);" ??? ???? ??????? ?? ??? ????? .CPP. ??? ???? ??????:
          BEGIN_MESSAGE_MAP(CMyDlgBar, CDialogBar)
    
             //{{AFX_MSG_MAP(CMyDlgBar)
             ...
             //}}AFX_MSG_MAP
             ON_MESSAGE(WM_INITDIALOG, OnInitDialog )    // <-- Add this line.
          END_MESSAGE_MAP()
    						
    ???? ? ????? OnInitDialog() ???????? ??? OnInitDialog() ??????? ???? ?? ???????.
  5. ????? ??????? OnInitDialog() ??? ???:
       Change the following:
    
          BOOL CMyDlgBar::OnInitDialog()
          {
             CDialog::OnInitDialog();   // <-- Replace this line:
                ...
    						
    ??????:
    LONG CMyDlgBar::OnInitDialog ( UINT wParam, LONG lParam)
             {
                              // <-- with these lines. -->
    
                BOOL bRet = HandleInitDialog(wParam, lParam);
    
                if (!UpdateData(FALSE))
                {
                   TRACE0("Warning: UpdateData failed during dialog init.\n");
                }
                ...
    
                return bRet;
    						
    ??? CDialogBar ?? ????? OnInitDialog() ????? ? ???????? ??????? ??? ?? ????. ??? ??????? ??? ????? UpdateData ?? ????? ?? ????? ?????? ???????.
  6. ???? ?? ????? ?????? ?? ???? ?????? ??????:
    ???: ???????
    boarder: ???
    ????: ????
    ????? ??? ??? ??????? ?? ??? ?? ?? ????? ????? ??????? ?? ??? CDialog ??? ??? CDialogBar ???? ???? ????. ????? ???? ?????????.
  7. ????? ???? CDialogBar ??????? ??? ??? ????? CframeWnd (???? ???? CMainFrame). ??? ???? ??????:
          class CMainFrame : public CFrameWnd
          {
              ...
              CMyDlgBar m_myDlgBar;
              ...
          };
    					
  8. ??????? ??????? ????? ????? m_myDlgBar ?? ????? CFrameWnd::OnCreate() ?????? ??? ???:
          int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
          {
             ...
             if (!m_myDlgBar.Create(this, IDD_DLGBAR1, CBRS_LEFT,
                IDD_DLGBAR1))
             {
                TRACE0("Failed to create dialog bar\n");
                return -1;      // fail to create
             }
             ...
          }
    					
  9. ???????? ??? ??? ???? ????? ??????? ??????? ????? ??? CDialogBar ??? ?????? ??????? ??? ????? CMainFrame::OnCreate():
          int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
          {
             ...
             m_myDlgBar.SetBarStyle(m_wndToolBar.GetBarStyle() |
                CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
             m_myDlgBar.EnableDocking(CBRS_ALIGN_ANY);
             DockControlBar(&m_myDlgBar);
    
             return 0;
          }

?????

????? ?? ?????????? ???? ??? ??? ??????? ?????? ?????? ?? "????? ??????? ?? Microsoft:
99161????? ????? ?? ?????? ??? ????? ?? ClassWizard

???????

???? ???????: 185672 - ????? ??? ??????: 30/????/1427 - ??????: 3.1
????? ???
  • Microsoft Foundation Class Library 4.2, ????? ?????? ??:
    • Microsoft Visual C++ 5.0 Enterprise Edition
    • Microsoft Visual C++ 6.0 Enterprise Edition
    • Microsoft Visual C++ 5.0 Professional Edition
    • Microsoft Visual C++ 6.0 Professional Edition
    • Microsoft Visual C++, 32-bit Learning Edition 6.0
????? ??????: 
kbmt kbhowto kbmfcctrlbar kbuidesign kbwizard KB185672 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????185672

????? ???????

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com