Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - Accelerators (Again)
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Accelerators (Again)

 Post Reply Post Reply
Author
Message
Simon HB9DRV View Drop Down
Senior Member
Senior Member
Avatar

Joined: 07 July 2005
Location: Switzerland
Status: Offline
Points: 458
Post Options Post Options   Thanks (0) Thanks(0)   Quote Simon HB9DRV Quote  Post ReplyReply Direct Link To This Post Topic: Accelerators (Again)
    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
Back to Top
rmercer View Drop Down
Groupie
Groupie


Joined: 22 February 2006
Status: Offline
Points: 34
Post Options Post Options   Thanks (0) Thanks(0)   Quote rmercer Quote  Post ReplyReply Direct Link To This Post 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?
Back to Top
Simon HB9DRV View Drop Down
Senior Member
Senior Member
Avatar

Joined: 07 July 2005
Location: Switzerland
Status: Offline
Points: 458
Post Options Post Options   Thanks (0) Thanks(0)   Quote Simon HB9DRV Quote  Post ReplyReply Direct Link To This Post Posted: 03 November 2006 at 10:39am
Thanks - spot on!
Simon HB9DRV
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.156 seconds.