Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - commandbars compile error
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

commandbars compile error

 Post Reply Post Reply
Author
Message
player98198 View Drop Down
Newbie
Newbie


Joined: 14 December 2007
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote player98198 Quote  Post ReplyReply Direct Link To This Post Topic: commandbars compile error
    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.
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 18 December 2007 at 11:42am
Hi,
you didn't derive dialog from CXTPDialog...
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
player98198 View Drop Down
Newbie
Newbie


Joined: 14 December 2007
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote player98198 Quote  Post ReplyReply Direct Link To This Post Posted: 18 December 2007 at 11:02pm
Is it still possible to do that? And how would I? Thanks
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
player98198 View Drop Down
Newbie
Newbie


Joined: 14 December 2007
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote player98198 Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 27 December 2007 at 8:31am
Hi,
Think you don't have text resource for indicators.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
player98198 View Drop Down
Newbie
Newbie


Joined: 14 December 2007
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote player98198 Quote  Post ReplyReply Direct Link To This Post 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?
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
player98198 View Drop Down
Newbie
Newbie


Joined: 14 December 2007
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote player98198 Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
player98198 View Drop Down
Newbie
Newbie


Joined: 14 December 2007
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote player98198 Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
player98198 View Drop Down
Newbie
Newbie


Joined: 14 December 2007
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote player98198 Quote  Post ReplyReply Direct Link To This Post 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?
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.059 seconds.