![]() |
CXTPCommandBar::LoadMenu Causing crash |
Post Reply ![]() |
Author | |||
MarkIRS ![]() Newbie ![]() Joined: 13 February 2006 Status: Offline Points: 4 |
![]() ![]() ![]() ![]() ![]() Posted: 14 February 2006 at 8:49am |
||
Hi Everyone, |
|||
![]() |
|||
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
||
Hello, We need sample application from you to see what you try to do. |
|||
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|||
![]() |
|||
MarkIRS ![]() Newbie ![]() Joined: 13 February 2006 Status: Offline Points: 4 |
![]() ![]() ![]() ![]() ![]() |
||
Hi Oleg,
We then dynamically re-populate m_pLayoutsPopupBar is the user has saved a new layout. To repopulate m_pLayoutsPopupBar we create a temporary CMenu, and then call the following to load the new menu:
This works fine the first time through, but the next time through the m_pControls member variable is invalid and the LoadMenu function causes a crash. I have been able to avoid the crash using the following code:
But that does not make my menu work. What I'm having trouble understanding is how m_pControls, a private member variable, is getting corrupted? I will keep trying to replicate it in a sample app, and if I am successful I will send you that. Hopefully in the mean time the above explanation will give you some ideas as to what the problem maybe. Also, we are using Visual Studio 6.0, MFC, and version 9.80 of your library. |
|||
![]() |
|||
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
||
Hello, It is very bad idea to store pointer m_pLayoutsPopupBar. - it will be corrupted if you Load previous state of commandbars or user made customization and delete some controls with this popup. (guess it is the reason that m_pControls is NULL)
|
|||
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|||
![]() |
|||
MarkIRS ![]() Newbie ![]() Joined: 13 February 2006 Status: Offline Points: 4 |
![]() ![]() ![]() ![]() ![]() |
||
Hi Oleg, Thanks for your help! |
|||
![]() |
|||
MarkIRS ![]() Newbie ![]() Joined: 13 February 2006 Status: Offline Points: 4 |
![]() ![]() ![]() ![]() ![]() |
||
Does anyone have any ideas how to do this? Basically I'm looking for information on how to repopulate a pupup menu at a given point while our program is running?
I've taken a look at the Dyamic Menu sample, but I cannot seem to get it working for a popup menu (CXTPPopupBar)? Any help with this would be appreciated. |
|||
![]() |
|||
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
||
Hello, I guess you can catch ON_XTP_INITCOMMANDSPOPUP() void CMainFrame::OnInitCommandsPopup(CXTPPopupBar* pCommandBar) if ThisIsMyPopup(pCommandBar ) pCommandBar->LoadMenu(&TempMenu,TRUE); } it will update menu before user popup it.
|
|||
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|||
![]() |
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 |