![]() |
Where are the accelerators? |
Post Reply
|
| Author | |
robosport
Groupie
Joined: 20 June 2005 Location: United States Status: Offline Points: 62 |
Post Options
Thanks(0)
Quote Reply
Topic: Where are the accelerators?Posted: 22 August 2005 at 4:09pm |
|
When I create an interface in the Command Bar Designer I add many keyboard accelerators. They show up on the menus when looking at the proejct in the command bar designer. When I load the interface into my application's main frame using LoadDesignerBars( ar ) the UI looks correct, and all of the defined IDs are there and work fine, but none of my custom accelerators show up on the menus. Any clue as to what am I forgetting to do? Thanks. Edited by robosport |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 23 August 2005 at 12:00am |
|
So you use it in MFC project? Where you call LoadDesignerBars? |
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
robosport
Groupie
Joined: 20 June 2005 Location: United States Status: Offline Points: 62 |
Post Options
Thanks(0)
Quote Reply
Posted: 23 August 2005 at 12:10am |
|
Yes, MFC. BOOL CMainFrame::LoadFrame(UINT nIDResource, DWORD dwDefaultStyle, CWnd* pParentWnd, CCreateContext* pContext) GenerateCommandBars(); LoadCommandBars(lpProfile); XTPShortcutManager()->LoadShortcuts(this, lpProfile); return TRUE; calls... void CMainFrame::GenerateCommandBars(){ CXTPCommandBars* pCommandBars = GetCommandBars(); pCommandBars->SetMenu( _T("Menu Bar"), 0); HRSRC hRsrs = FindResource(AfxGetInstanceHandle(), ASSERT(hRsrs); if (hRsrs) if (hGlobal) LPVOID pData = LockResource(hGlobal); CMemFile file((BYTE*)pData, dwSize); CArchive ar(&file, CArchive::load | CArchive::bNoFlushOnDelete); pCommandBars->LoadDesignerBars(ar); XTAuxData().InitResources(AfxGetInstanceHandle()); Thanks. |
|
![]() |
|
robosport
Groupie
Joined: 20 June 2005 Location: United States Status: Offline Points: 62 |
Post Options
Thanks(0)
Quote Reply
Posted: 23 August 2005 at 1:56am |
|
Oleg, you always know exactly what to ask to help me find my own bugs. I noticed when pasting the above code into the reply that I had a leftover call to: XTPShortcutManager()->LoadShortcuts(this, lpProfile); ...which overrides the accelerators in the designer resource with whatever is in the registry. I removed that line and everything works as expected now. Thanks! |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 23 August 2005 at 6:46am |
|
hmm... removing this line you don't allow users to customize shortcuts... (if allowed) if you allow to customize shortcuts, try to restore this line and delete old registry settings. |
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
robosport
Groupie
Joined: 20 June 2005 Location: United States Status: Offline Points: 62 |
Post Options
Thanks(0)
Quote Reply
Posted: 23 August 2005 at 6:50am |
|
Thanks for the information. I don't currently support customizing shortcuts but when I add that functionality I'll remember to put this back in. So are you saying that the old registry settings for the shortcuts were overriding the command bar designer shortcuts, and if I was running this app for the first time on a new computer the shortcuts should work even with this line in the code? Thanks again. |
|
![]() |
|
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 |