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 » problem with CExtToolControlBar Collapse All
Subject Author Date
Gary Hughes Jul 11, 2002 - 12:18 AM

Hi,

I have derived a new class from CExtToolControlBar, the toolbar has 2 buttons. On the Create method I replace the two buttons with CDateTimeCtrl’s which are members of my derived class as follows.

BOOL CMatchHistoryViewControlBar::Create(LPCTSTR lpszWindowName, CWnd* pParentWnd, UINT nID, DWORD dwStyle)
{
    if(!CExtToolControlBar::Create(lpszWindowName, pParentWnd, nID) ||
     !CExtToolControlBar::LoadToolBar(IDR_MATCH_HISTORY_TOOLBAR))
    {
        return FALSE;
    }

    if(!m_MatchHistoryFrom.Create(WS_CHILD|WS_VISIBLE, CRect(0,0,90,20), this, ID_MATCH_HISTORY_FROM) ||
     !SetButtonCtrl(CommandToIndex(ID_MATCH_HISTORY_FROM), &m_MatchHistoryFrom))
    {
        TRACE0("Failed to create date time ctrl\n");
        return FALSE;
    }

    if(!m_MatchHistoryTo.Create(WS_CHILD|WS_VISIBLE, CRect(0,0,90,20), this, ID_MATCH_HISTORY_TO) ||
     !SetButtonCtrl(CommandToIndex(ID_MATCH_HISTORY_TO), &m_MatchHistoryTo))
    {
        TRACE0("Failed to create date time ctrl\n");
        return FALSE;
    }

    return TRUE;
}

The toolbar and date time controls appear to be created fine, however, when I click on either of the date time controls I usually get an assertion on the following line.

CExtCommandMgr.h:688

It doesn’t always do this but most of the time it does. When it works everything seems fine and I get notifications from the date time controls in my view class etc.

Any ideas?

thanks.

Gary.

Sergiy Lavrynenko Jul 14, 2002 - 8:41 AM

Dear Gary Hughes,
I can not confirm this bug.
Perhaps the problem is somewhere in command routing.
Can you drop me letter with your VC++ project?

Best regards,
Sergiy Lavrynenko.