Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Assert in CustomizeKeyboardPage
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Assert in CustomizeKeyboardPage

 Post Reply Post Reply
Author
Message
danpetitt View Drop Down
Senior Member
Senior Member


Joined: 17 July 2005
Location: United Kingdom
Status: Offline
Points: 109
Post Options Post Options   Thanks (0) Thanks(0)   Quote danpetitt Quote  Post ReplyReply Direct Link To This Post Topic: Assert in CustomizeKeyboardPage
    Posted: 31 July 2006 at 2:55pm
I am getting an ASSERT in CXTPCustomizeKeyboardPage Constructor:
 ASSERT(pSheet->GetCommandBars()->GetShortcutManager()->GetOriginalAccelerator());
 
These are my calls in CMainFrm::OnCreate:
 pCommandBars->GetCommandBarsOptions()->ShowKeyboardCues( xtpKeyboardCuesShowWindowsDefault );
 pCommandBars->GetToolTipContext()->SetStyle( xtpToolTipOffice );
 pCommandBars->GetShortcutManager()->SetAccelerators( IDR_MAINFRAME );
 pCommandBars->GetShortcutManager()->SetAccelerators( IDR_SGENIETYPE );
 
Why is this, whats an OriginalAccelerator, why do I need it and why isnt it there?
 
I am not using "LoadCommandBars" to load/save them, I am using PropExchange.
 
Can you point me in the right direction.
Back to Top
Oleg View Drop Down
Senior Member
Senior Member


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: 31 July 2006 at 3:22pm
Don't call
pCommandBars->GetShortcutManager()->SetAccelerators( IDR_SGENIETYPE );
just
pCommandBars->GetShortcutManager()->SetAccelerators( IDR_MAINFRAME );
 
only last accelerators for last call used.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
danpetitt View Drop Down
Senior Member
Senior Member


Joined: 17 July 2005
Location: United Kingdom
Status: Offline
Points: 109
Post Options Post Options   Thanks (0) Thanks(0)   Quote danpetitt Quote  Post ReplyReply Direct Link To This Post Posted: 31 July 2006 at 3:43pm

Problem is, I am not getting any of my mainframe shortcuts in the customize dialog or available to my application without using the "SetAccelerators(IDR_SGENIETYPE)".

Back to Top
danpetitt View Drop Down
Senior Member
Senior Member


Joined: 17 July 2005
Location: United Kingdom
Status: Offline
Points: 109
Post Options Post Options   Thanks (0) Thanks(0)   Quote danpetitt Quote  Post ReplyReply Direct Link To This Post Posted: 31 July 2006 at 5:15pm
What I found is that my DoPropExchange on (first time) is destroying the accelerator table ready for loading in, but there is nothing to load in so now I have no accelerators.
 
Any ideas what to do?
Back to Top
danpetitt View Drop Down
Senior Member
Senior Member


Joined: 17 July 2005
Location: United Kingdom
Status: Offline
Points: 109
Post Options Post Options   Thanks (0) Thanks(0)   Quote danpetitt Quote  Post ReplyReply Direct Link To This Post Posted: 31 July 2006 at 5:25pm

More investigation seems that if the saved XML file doesnt have any shortcut section then it clears the accelerator table and cant fill it back with anything.

What it ought to do is only UpdateAcellTable (CXTPShortcutManager::DoPropExchange) if "accels.GetSize()" then it will only replace when there is something to replace it with.

Or even modify "CXTPShortcutManager::UpdateAcellTable":

void CXTPShortcutManager::UpdateAcellTable(LPACCEL lpAccel, int nSize)
{
 HACCEL hAccelNew = ::CreateAcceleratorTable(lpAccel, nSize);
 if( hAccelNew )
 {
   SAFE_DESTROY_ACCELTABLE(m_hAccelTable);
   m_hAccelTable = hAccelNew;
 }
}
 
Back to Top
Oleg View Drop Down
Senior Member
Senior Member


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: 01 August 2006 at 9:29am
Hello,
no, it is designed behaviour. don't change it.  Just delete old xml configuration file.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
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.047 seconds.