Print Page | Close Window

Accelerators (Again)

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=5420
Printed Date: 04 March 2025 at 6:57am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Accelerators (Again)
Posted By: Simon HB9DRV
Subject: Accelerators (Again)
Date Posted: 03 November 2006 at 6:07am
Brilliant - my brand new program displays the accelerators (F1 - F5 and F8) in menus and toolbars but they don't work - pressing F8 has no effect.

Another program works well.

Any ideas? I use a standard Accelerator table in Visual Studio 6.0 and am slowly going crazy :-)

It makes no difference at all when I add the line below: pCommandBars->GetShortcutManager()->SetAccelerators(IDR_MAINFRAME);



-------------
Simon HB9DRV



Replies:
Posted By: rmercer
Date Posted: 03 November 2006 at 9:24am
Originally posted by Simon HB9DRV Simon HB9DRV wrote:

Brilliant - my brand new program displays the accelerators (F1 - F5 and F8) in menus and toolbars but they don't work - pressing F8 has no effect.

Another program works well.

Any ideas? I use a standard Accelerator table in Visual Studio 6.0 and am slowly going crazy :-)

It makes no difference at all when I add the line below: pCommandBars->GetShortcutManager()->SetAccelerators(IDR_MAINFRAME);

I experienced a similar issue caused by my override of CMainFrame::PreTranslateMessage.
 
My return was: CFrameWnd::PreTranslateMessage(pMsg);
when it should have been: CXTPFrameWnd::PreTranslateMessage(pMsg);
 
Example:
BOOL CMainFrame::PreTranslateMessage(MSG* pMsg)
{
  return CXTPFrameWnd::PreTranslateMessage(pMsg);
}
 
As soon as I fixed it to match the class I was actually using, the accelerator keys worked perfectly.
 
Perhaps your issue is the same as mine?


Posted By: Simon HB9DRV
Date Posted: 03 November 2006 at 10:39am
Thanks - spot on!

-------------
Simon HB9DRV



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net