Print Page | Close Window

commandbars compile error

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=9135
Printed Date: 05 February 2025 at 11:50am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: commandbars compile error
Posted By: player98198
Subject: commandbars compile error
Date Posted: 18 December 2007 at 10:43am
for some reason i keep getting compile errors when trying to incorporate command bars.in the oninit i have

    VERIFY(InitCommandBars());
    CXTPCommandBars* pCommandBars = GetCommandBars();
    pCommandBars->SetMenu(_T("Menu Bar"), IDR_MAINMENU);
    LoadCommandBars(_T("CommandBars"));

but i keep getting following errors

...error C2065: 'InitCommandBars' : undeclared identifier
...error C2065: 'GetCommandBars' : undeclared identifier
...error C2440: 'initializing' : cannot convert from 'int' to 'class CXTPCommandBars *'
        Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
...error C2065: 'LoadCommandBars' : undeclared identifier

i am using vc 6 and i compiled the dialogsample commandbar and that works perfectly.just not sure what i am missing.



Replies:
Posted By: Oleg
Date Posted: 18 December 2007 at 11:42am
Hi,
you didn't derive dialog from CXTPDialog...


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: player98198
Date Posted: 18 December 2007 at 11:02pm
Is it still possible to do that? And how would I? Thanks

-------------
http://www.pennybiddr.com - Loving life!


Posted By: Oleg
Date Posted: 19 December 2007 at 10:57am
Is it possible to do what ?
 
you need override from CXTPDialog to use these methods.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: player98198
Date Posted: 27 December 2007 at 5:02am
I have derived the class and now when compiling (debug) the menu and status bar do not appear.


    if (!m_wndStatusBar.Create(this) ||
        !m_wndStatusBar.SetIndicators(indicators,
        sizeof(indicators)/sizeof(UINT)))
    {
        TRACE0("Failed to create status bar\n");
        return -1;      // fail to create
    }
    m_wndStatusBar.SetPaneInfo(0, IDI_STATUSBAR_INFO1, SBPS_STRETCH, 100);

Happens during that portion of the code. I have my app setup as identical as I can get it with the sample.
Failed to create status bar


-------------
http://www.pennybiddr.com - Loving life!


Posted By: Oleg
Date Posted: 27 December 2007 at 8:31am
Hi,
Think you don't have text resource for indicators.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: player98198
Date Posted: 05 January 2008 at 5:42am
I am using
    // Creating Menus using (Codejock Command Bars)
   
    if (!m_wndStatusBar.Create(this) ||
        !m_wndStatusBar.SetIndicators(indicators,
        sizeof(indicators)/sizeof(UINT)))
    {
        TRACE0("Failed to create status bar\n");
        return -1;      // fail to create
    }
   

    m_wndStatusBar.SetPaneInfo(1, IDI_STATUSBAR_INFO1, SBPS_STRETCH, 100);
    VERIFY(InitCommandBars());

        CXTPCommandBars* pCommandBars = GetCommandBars();
    if(pCommandBars == NULL)
    {
        TRACE0("Failed to create command bars object.\n");
        return -1;      // fail to create
    }
    CXTPMenuBar* pMenuBar = pCommandBars->SetMenu(_T("Menu Bar"), IDR_MENU);
    if(pMenuBar == NULL)
    {
        TRACE0("Failed to create menu bar.\n");
        return -1;      // fail to create
    }

in the Oninit, but I keep getting a "Failed to create status bar" during debug. How would I fix this?

Also the menu is not showing either, is there something I am missing?


-------------
http://www.pennybiddr.com - Loving life!


Posted By: Oleg
Date Posted: 05 January 2008 at 2:58pm

Problem in your line m_wndStatusBar.SetIndicators(indicators, ..);

you don't have string resources for ids in indicators array.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: player98198
Date Posted: 13 February 2008 at 12:52am
Hi,

I don't quite understand, I have this after MESSAGE_MAP routine

static UINT indicators[] =
{
    ID_SEPARATOR,
    IDI_STATUSBAR_INFO1,
    IDI_STATUSBAR_NUMFILES,

};

then in OnInit I have

    if (!m_wndStatusBar.Create(this) || !m_wndStatusBar.SetIndicators(indicators,sizeof(indicators)/sizeof(UINT)))
    {
        TRACE0("Failed to create status bar\n");
        return -1;      // fail to create
    }
    m_wndStatusBar.SetPaneInfo(0, IDI_STATUSBAR_INFO1, SBPS_STRETCH, 100);
    m_bInitDone = TRUE;
    RepositionControls();

    m_szMin = m_szWindow;

But the program loads but crashe's right away.


Posted By: Oleg
Date Posted: 13 February 2008 at 1:11am
In your resource file do you have strings for IDI_STATUSBAR_INFO1/IDI_STATUSBAR_NUMFILES ?

-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: player98198
Date Posted: 13 February 2008 at 1:13am
Thanks for the reply, yeah there in the resource file.

#define IDI_STATUSBAR_NUMFILES          4564
#define IDI_STATUSBAR_INFO1             103


Posted By: player98198
Date Posted: 13 February 2008 at 1:16am
Once I removed those everything started to work! Only thing now is how would I put the values that IDI_STATUSBAR_NUMFILES and IDI_STATUSBAR_INFO1  used to hold before I started using command bars?



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net