|
|
|
|
Forum
Please
Log In
to post a new message or reply to an existing one. If you are not registered, please
register.
NOTE: Some forums may be read-only if you are not currently subscribed to
our technical support services.
Subject |
Author |
Date |
|
Sergey Navasardian
|
Jul 12, 2006 - 6:46 AM
|
I created CToolBarDialog from CExtResizableDialog like : ------------------------------------------------------------------------------------------------- class CToolBarDialog : public CExtResizableDialog { class CInnerToolControlBar : public CExtToolControlBar { virtual CExtBarContentExpandButton * OnCreateBarRightBtn() { return NULL; } }; public: CInnerToolControlBar m_wndToolBar; CExtWFF<CTreeCtrl> m_wndTreeCtrl; public: CToolBarDialog(CWnd* pParent = NULL); // standard constructor virtual ~CToolBarDialog(); enum { IDD = IDD_DIALOG_WITH_TOOLBAR }; protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
DECLARE_MESSAGE_MAP() public: virtual BOOL OnInitDialog(){ CExtResizableDialog::OnInitDialog();
ShowSizeGrip(FALSE); m_wndToolBar.LoadToolBar(IDR_SEC_TOOLBAR); static UINT arrTbBtn[] = { ID_TD_BTN1, ID_TD_BTN2, ID_TD_BTN3, ID_SEPARATOR, ID_TD_BTN4, }; VERIFY( m_wndToolBar.SetButtons(arrTbBtn, sizeof(arrTbBtn)/sizeof(arrTbBtn[0])) ); ShowSizeGrip(FALSE);
CProfStudioThinFrame * pWndThinFrame = new CProfStudioThinFrame; if( ! pWndThinFrame-> CreateDynamicThinFrame( &m_wndTreeCtrl ) ) { ASSERT( FALSE ); return FALSE; }
RepositionBars( 0, 0xFFFF, IDC_TREE1 ); } public: afx_msg void OnSize(UINT nType, int cx, int cy); public: afx_msg void OnSetFocus(CWnd* pOldWnd); }; ----------------------------------------------------------------------------------------------- [In MainFrm]
CExtControlBar m_wndResizableBarDlg_Custom; CToolBarDialog m_wndDockedResizedDialog_Custom;
if( !m_wndResizableBarDlg_Custom.Create( //this is success _T("PLZ"), this, ID_TB_DIALOG, WS_CHILD|WS_VISIBLE|CBRS_TOP|CBRS_GRIPPER |CBRS_TOOLTIPS |CBRS_FLYBY |CBRS_SIZE_DYNAMIC |CBRS_HIDE_INPLACE ) ) { TRACE0("Failed to create m_wndResizableBarDlg\n"); return -1; }
//////////////////////////////////////////////////////////////////////// // m_wndDockedResizedDialog_Custom was NOT created!!!!!!!!!! if( !m_wndDockedResizedDialog_Custom.Create( CToolBarDialog::IDD, &m_wndResizableBarDlg_Custom ) ) { TRACE0("Failed to create m_wndResizableBarDlg\n"); //return -1; // fail to create }
--------------------------------------------------------------------------------------------------
m_wndDockedResizedDialog_Custom is NULL !!!!! let me know how to resolve this problem...
|
|
Technical Support
|
Jul 12, 2006 - 10:50 AM
|
The most probable cause of the problem is invalid subclassing of dialog controls. Please check all the lines in the CToolBarDialog::DoDataExchange() method . You should comment all the lines corresponding to dialog controls and then uncomment them line by line and run your project. This should help.
|
|
Technical Support
|
Jul 12, 2006 - 10:52 AM
|
Please also make sure that you added the following line to the DoDataExchange procedure: DDX_Control( pDX, IDC_TOOLBAR, m_wndToolBar );
|
|