![]() |
commandbars compile error |
Post Reply ![]() |
Author | |
player98198 ![]() Newbie ![]() Joined: 14 December 2007 Status: Offline Points: 8 |
![]() ![]() ![]() ![]() ![]() 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. |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi,
you didn't derive dialog from CXTPDialog...
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
player98198 ![]() Newbie ![]() Joined: 14 December 2007 Status: Offline Points: 8 |
![]() ![]() ![]() ![]() ![]() |
Is it still possible to do that? And how would I? Thanks
|
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Is it possible to do what ?
you need override from CXTPDialog to use these methods.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
player98198 ![]() Newbie ![]() Joined: 14 December 2007 Status: Offline Points: 8 |
![]() ![]() ![]() ![]() ![]() |
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 |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi,
Think you don't have text resource for indicators.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
player98198 ![]() Newbie ![]() Joined: 14 December 2007 Status: Offline Points: 8 |
![]() ![]() ![]() ![]() ![]() |
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? |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
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 |
|
![]() |
|
player98198 ![]() Newbie ![]() Joined: 14 December 2007 Status: Offline Points: 8 |
![]() ![]() ![]() ![]() ![]() |
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. |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
In your resource file do you have strings for IDI_STATUSBAR_INFO1/IDI_STATUSBAR_NUMFILES ?
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
player98198 ![]() Newbie ![]() Joined: 14 December 2007 Status: Offline Points: 8 |
![]() ![]() ![]() ![]() ![]() |
Thanks for the reply, yeah there in the resource file.
#define IDI_STATUSBAR_NUMFILES 4564 #define IDI_STATUSBAR_INFO1 103 |
|
![]() |
|
player98198 ![]() Newbie ![]() Joined: 14 December 2007 Status: Offline Points: 8 |
![]() ![]() ![]() ![]() ![]() |
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?
|
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |