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 » AVIFrames seek bar problem Collapse All
Subject Author Date
Soo Wei Tan Aug 23, 2006 - 4:59 PM

I’m following the AVIFrames example and I’m running into a couple of problems. I’m basically using the code as a base for an application, and asserts whenever I reach the following code:

CExtCmdItem * pCmdItemScroller =
        g_CmdManager->CmdAllocPtr(
        pApp->m_pszProfileName,
        ID_MYEXTBTN_SCROLLER
        );
    ASSERT( pCmdItemScroller != NULL );
    pCmdItemScroller->m_sToolbarText = _T("Seek:");
    pCmdItemScroller->m_sMenuText = _T("Seek slider");
    pCmdItemScroller->m_sTipTool
        = pCmdItemScroller->m_sTipStatus
        = _T("Seek slider");

According to the debugger, ID_MYEXTBTN_SCROLLER is not found. However, I have assigned it just like in the example in my header file. Is there something painfully obvious that I am missing?

Soo Wei Tan Sep 1, 2006 - 11:52 AM

Speaking of seek bars, how do I make it stretch to fit the size of the window it is in?

Technical Support Sep 3, 2006 - 1:26 PM

To make a button auto-sizable in a toolbar, create a CExtToolControlBar-derived class and override the CExtToolControlBar::_RecalcPositionsImpl() internal virtual method in it. This is not difficult if you need to auto-size only one button in the toolbar. We have a ready -to-use solution. Please download the following application, which auto-sizes the combo box button in toolbar.

Soo Wei Tan Aug 31, 2006 - 10:46 AM

Thanks, that did the trick!

Soo Wei Tan Aug 30, 2006 - 5:15 PM

I figured out statBasicCommands, but here is another problem I have.

I am asserting at
if( !CExtCustomizeSite::EnableCustomization(
    this,
    __ECSF_DEFAULT|__ECSF_PARMS_DISABLE_PERSONALIZED
    )
    )
{
    ASSERT( FALSE );
    return -1;
}

The assertion is caused by the file ExtCustomize.cpp at line 6271.

Technical Support Aug 31, 2006 - 9:15 AM

Please make sure that you invoke the AfxOleInit() method, which initializes OLE support needed forthe customization subsystem. You should place this method into your InitInstance() method.

Soo Wei Tan Aug 30, 2006 - 4:16 PM

I am now asserting at
VERIFY(
    g_CmdManager->SetBasicCommands(
        pApp->m_pszProfileName,
        statBasicCommands
    ));

What is the purpose of the array of statBasicCommands? What is to be put in there?

Soo Wei Tan Aug 30, 2006 - 4:12 PM

I don’t know what I did but it works now. :)

Soo Wei Tan Aug 30, 2006 - 3:54 PM

This is the first time I am calling ::CmdAllocPtr(). It has not been invoked implicitly by any of the other methods too. The profile name is valid too.

Searching my code for occurences of ID_MYEXTBTN_SCROLLER produces exactly the same results as the AVIFrames example, so I have no idea what is happening right now.

Soo Wei Tan Aug 24, 2006 - 11:03 AM

That is the assertion that produces the failure. ID_MYEXTBTN_SCROLLER has a unique identifier so I don’t think there is identifier collision.

Just to confirm, all I have to do before calling CmdAllocPtr() is add the resource symbol. Is there anything else that needs to be done?

Technical Support Aug 25, 2006 - 5:56 AM

As we said earlier CExtCmdManager::CmdAllocPtr() can fail and return NULL if the specified command identifier is already allocated. This may happen if the CExtCmdManager::CmdAllocPtr() method is called twice or more times to allocate the same command identifier. The first time this method is invoked explicitly from your code or might be invoked implicitly from one of Prof-UIS methods: CExtCmdManager::UpdateFromMenu(), CExtCmdManager::UpdateFromToolBar(), CExtMenuControlBar::LoadMenuBar() or CExtToolControlBar::LoadToolBar(). Additionally, the CExtCmdManager::CmdAllocPtr() method can fail and return NULL if the specified command profile name is not valid. So, please also check whether you have initialized the command profile by invoking the CExtCmdManager::ProfileSetup() or CExtCmdManager::ProfileWndAdd() methods.

Soo Wei Tan Aug 23, 2006 - 6:04 PM

Just to follow up, I have declared ID_MYEXTBTN_SCROLLER in resource.h already, using the Resource Symbols dialog. Is there anything else that needs to be done before I can use it? It is only currently used by the string table.

Technical Support Aug 24, 2006 - 8:34 AM

We guess ASSERT( pCmdItemScroller != NULL ) produces the assertion failure. The CExtCmdManager::CmdAllocPtr() method allocates a new CExtCmdItem command description in the command manager. It can return NULL if the specified ID_MYEXTBTN_SCROLLER command identifier is already allocated. So we guess you have identifier collision. Please check whether you defined _MYEXTBTN_SCROLLER equal to some other command identifier in your project.