Professional UI Solutions
Site Map   /  Register
 
 

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.

Forums » Prof-UIS General Discussion » How to fit CScrollView to CExtControlBar Collapse All
Subject Author Date
Rho Pu Reun Mar 14, 2006 - 7:57 AM

Hello.
I cannot write English well.
(It used the web translator)

I maked sample source
but i have one question.

class CMainFrame : public CFrameWnd
{
private:
    CExtCTA < CExtControlBar >            m_wndTestResizableBar;
    ...
};

int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{    
    // load frame window, bars information
    if( ! CExtControlBar::ProfileBarStateLoad(...) )
    {
        // fail to load
        ...
        m_wndTestResizableBar.FloatControlBar();
        ...
    }    
}
BOOL CMainFrame::DestroyWindow()
{
    ...
    CExtControlBar::ProfileBarStateSave();
    ...
}

BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
    if( !m_wndTestResizableBar.Create( _T("Test ResizableBar"), this, ID_TEST_RESIZABLE_BAR ) )
    {
        TRACE0("Failed to create m_wndTestResizableBar\n");
        return -1;        // fail to create
    }

    // class CTestScrollView : public CScrollView
    CRuntimeClass *pRuntimeClass = RUNTIME_CLASS(CTestScrollView);
    CTestScrollView* pTSV = (CTestScrollView*)pRuntimeClass->CreateObject();
    pTSV->Create( NULL, NULL, AFX_WS_DEFAULT_VIEW,
        CRect(0, 0, 1, 1), &m_wndTestResizableBar,
        m_wndTestResizableBar.GetDlgCtrlID(), pContext );    // Floating CExtControlBar Not Appear
//        m_wndTestResizableBar.GetDlgCtrlID(), NULL );    // Floating CExtControlBar Appear(But I Need CDocument)
}

When it executes it operates initially well.
After when information of frame window and the Bar is stored in the Registry, it executes again
The Floating the CExtControlBar does not appear

I found the cause of problem.
(★ The last parameter which it passes over, when creating the CScrollView ★)

If it passes over the NULL it executes again, the Floating CExtControlBar appear
But passes over the pContext, the Floating CExtControlBar does not appear

It uses the CDocument from the CScrollView.
So When creating the CScrollView, is not a possibility of passing over the NULL to last parameter.

To teach a solution.
Thank you.

Technical Support Mar 14, 2006 - 9:59 AM

Could you send us your test project so that we can help you in the fastest way?