|
I'm not at your skill level, but I would create a new project as a test, and add the \t F5, and see if you get the same result.
|
|
|
|
|
jkirkerx wrote: ...I would create a new project as a test, and add the \t F5, and see if you get the same result. Same result. I created a new SDI project, ran it without any mods, and I see the stock set of accelerator keys in the submenus. So I created a menu and added a few submenu items, each with an accelerator key. For simplicity, I deleted IDR_MAINFRAME , and renamed my menu to IDR_MAINFRAME . Running the app now shows my menu and submenus but does not show the accelerator keys.
I took it one step further and rather than create a new menu to replace a stock one, I simply made a change to the IDR_MAINFRAME menu. For the Save option, I changed Ctrl+S to F2. While F2 shows up in the menu editor next to Save, when I run the app, Ctrl+S still shows up next to Save in the File menu. I also added F3 to one of the Office themes in the View menu. It does not show up at all. I've looked at the project's .rc file in Notepad and there's no sign of Ctrl+S. I've cleaned the project so it rebuilt everything.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
modified 17-Apr-12 15:51pm.
|
|
|
|
|
I created a Win32 non empty test project in VS2008 and it worked fine. I hand edited the rc file, and added \t Alt-F5 to Exit in the File Column.
I doubt if this is of any help, but this is my rc file content from the test project. Perhaps there's something in there you don't have. I'm sure it's the \t that's terminating the menu item value, just not sure why.
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
#ifndef APSTUDIO_INVOKED
#include "targetver.h"
#endif
#define APSTUDIO_HIDDEN_SYMBOLS
#include "windows.h"
#undef APSTUDIO_HIDDEN_SYMBOLS
#undef APSTUDIO_READONLY_SYMBOLS
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
LANGUAGE 9, 1
#pragma code_page(1252)
IDI_MENUTESTDELETE ICON "MenuTestDelete.ico"
IDI_SMALL ICON "small.ico"
IDC_MENUTESTDELETE MENU
BEGIN
POPUP "&File"
BEGIN
MENUITEM "E&xit\t Alt-F5", IDM_EXIT
END
POPUP "&Help"
BEGIN
MENUITEM "&About ...", IDM_ABOUT
END
END
IDC_MENUTESTDELETE ACCELERATORS
BEGIN
"?", IDM_ABOUT, ASCII, ALT
"/", IDM_ABOUT, ASCII, ALT
END
IDD_ABOUTBOX DIALOGEX 0, 0, 170, 62
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "About MenuTestDelete"
FONT 8, "MS Shell Dlg"
BEGIN
ICON IDR_MAINFRAME,IDC_STATIC,14,14,21,20
LTEXT "MenuTestDelete, Version 1.0",IDC_STATIC,42,14,114,8,SS_NOPREFIX
LTEXT "Copyright (C) 2012",IDC_STATIC,42,26,114,8
DEFPUSHBUTTON "OK",IDOK,113,41,50,14,WS_GROUP
END
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO
BEGIN
IDD_ABOUTBOX, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 163
TOPMARGIN, 7
BOTTOMMARGIN, 55
END
END
#endif // APSTUDIO_INVOKED
#ifdef APSTUDIO_INVOKED
1 TEXTINCLUDE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE
BEGIN
"#ifndef APSTUDIO_INVOKED\r\n"
"#include ""targetver.h""\r\n"
"#endif\r\n"
"#define APSTUDIO_HIDDEN_SYMBOLS\r\n"
"#include ""windows.h""\r\n"
"#undef APSTUDIO_HIDDEN_SYMBOLS\r\n"
"\0"
END
3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
STRINGTABLE
BEGIN
IDC_MENUTESTDELETE "MENUTESTDELETE"
IDS_APP_TITLE "MenuTestDelete"
END
#endif
#ifndef APSTUDIO_INVOKED
#endif // not APSTUDIO_INVOKED
|
|
|
|
|
jkirkerx wrote: I created a Win32 non empty test project SDI or dialog-based? If the former, what style did you opt for?
jkirkerx wrote: ...I hand edited the rc file, and added \t Alt-F5 to Exit in the File Column.
I did the same thing. It failed to show at runtime. It shows in the menu editor, however.
I still don't understand how I removed Ctrl+S earlier (there's no sign of it in the .rc file) and it still shows up at runtime.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
Opened Visual Studio 2008 on Windows XP
New Project
Visual C++
Win32 Project
TestProject
OK
Welcome to the Win32 Application Wizard - Next
Windows Application
Finish
Right Clicked TestProject.rc - > View Code
Went to MENUITEM "E&xit"
typed in "E&xit\t Alt-F5"
Save
Run
I get the Exit tab Alt-F5 in the menu bar
I didn't add an accelerator to it, just wanted to see if it displays.
Properties
Use of MFC - Use Standard Windows Library
Use of ATL - Not using ATL
Character Set - Use Unicode Character Set
|
|
|
|
|
jkirkerx wrote: Opened Visual Studio 2008 on Windows XP New Project Visual C++ Win32 Project
The problem has to do with MFC.
[edit]
Related questions here and here.
[/edit]
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
modified 18-Apr-12 11:13am.
|
|
|
|
|
I had the problem where the Alt-X worked for Exit, but my Alt-F5 work not do anything.
I loaded the accelerators,
HACCEL hAccelTable_Main, hAccelTable_Keys;
hAccelTable_Main = LoadAccelerators( hInstance, MAKEINTRESOURCE( IDR_NASE2012_SUWIZARD ));
hAccelTable_Keys = LoadAccelerators( hInstance, MAKEINTRESOURCE( IDA_KEYBOARD_ACCELERATORS ));
And then I realized I had to capture the messages. So now both sets of accelerators work concurrently.
while ((bReturn = GetMessage(&msg, NULL, 0, 0)) !=0) {
if (bReturn == -1) {
}
else {
if (( !TranslateAccelerator( g_hWndMainFrame, hAccelTable_Main, &msg )) && ( !TranslateAccelerator( g_hWndMainFrame, hAccelTable_Keys, &msg ))) {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
}
|
|
|
|
|
I've done this before with Win32 and with dialog-based applications. Not something you typically have to do, however, with an SDI (MFC) application.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
That's why I started with win32, to learn the basics or foundation first. Then I can just perhaps upgrade my app to MFC.
Good to hear your accelerators work and display correctly now. I'm sure that was a head banger.
I'll be posting my head banger soon today, after I have exhausted Google, Docked toolbars.
|
|
|
|
|
The code below includes NameOfClass in debug build.
#ifdef _DEBUG
friend class NameOfClass;
#endif
How do I exclude NameOfClass from release build in vs2008?
Thanks
modified 16-Apr-12 11:54am.
|
|
|
|
|
You're already excluding it with that statement. If you want to exclude the whole class completely, wrap the include statement with that same pre-processor directive.
|
|
|
|
|
|
Hello,
I developed an MFC application in vs2008 and it works fine.
After compiling the project in vs2010 the program crushes when i run it(the compilation goes fine).
What could be the problem?
Thanks.
|
|
|
|
|
Your glurblecruncheon interfaced with your gobblewarts.
It's not sufficient to say that it crashes - what is it doing when it crashes? What environment is it running on? What does the code actually look like at this point? Is anything written to the event log?
|
|
|
|
|
Does the application say anything when it crashes? Does it crash in both debug and release modes? Does it crash immediately or run for a while? If it crashes immediately, why not just look at the call stack to see where it crashes.
You need to provide a lot more information...
|
|
|
|
|
Dear friend don't worry it is a normal issue. The solution is available at http://connect.microsoft.com/VisualStudio/feedback/details/527167/upgraded-2008-project-compile-error-filetracker-dll
|
|
|
|
|
1. You should reply to the OP not to others who offer answers.
2. You should make your links clickable; like this[^].
Binding 100,000 items to a list box can be just silly regardless of what pattern you are following. Jeremy Likness
|
|
|
|
|
Perhaps you should have replied to the original poster, rather than to Albert. He isn't the one having the issue, and the original poster doesn't receive notifications of replies to other people.
|
|
|
|
|
Am really sorry, am new to this session
|
|
|
|
|
Have a look to the thread, Member4725068 gave a link where it is explained, which was reposted as a clickable link by Richard MacCutchan
Regards.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpfull answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
|
I have been working with MFC for many years. I know the library and specially my way around to make my programs. Right now my career is not very into programming so I'm not over the newest and biggest wave around. Basically I’m programming for my pleasure and maintaining some programs I have. My doubts arise when you start seen winRT, .net and all those fireworks that we see every day. I want to keep doing what I do, but not be a dinosaur that someday realizes that it’s like still programming for Windows 98. What are your opinins and recommendations as what should be my next step (MFC, WinRT, TheBestFramerorkEver, etc.)
|
|
|
|
|
Personally, I would give a try to WinRT.
Veni, vidi, vici.
|
|
|
|
|
If you're a long time Windows/MFC programmer get away from Microsoft stuff for a while. It's very easy to get wedded to a particular vendor's tools and end up locked into their corporate strategy. Then when they bugger off in a different direction you end up trying to get up to speed with something else fast.
So spread your wings a bit...
- Pick up a linux or FreeBSD distribution and see how you can write code for them and how it's different/same as for Windows
- Grab a portable application framework (WxWidgets is good if you're well used to MFC) and see how you can build it and use it
- Learn another language like Python or Haskell. Python's a surprisingly close to C++ despite looking totally different and Haskell's a completely different programming model
- Reads loads of books about how to write large systems and see how that's different from how you write small ones
- Find an Open Source project that sounds interesting and a bit outside your comfort zone to expose you to how other people write code (get prepared to say WTF? and Ugh! a lot)
- If you REALLY want to stay programming just for Windows start writing the odd app in C rather than C++. Then try VB to see how that's different
Er, sorry, rambling, will stop now.
Good luck!
Ash
|
|
|
|
|
Thank you for your point of view. It surprices me that your recommendation is not in MS world. I like C++ as a language because for me it feels natural to me. I have programmed in many languages, some high level, others not so much, but I always come back to C++.
I would like to know if there other adventages to WxWidgets besides portability becasuse most of my programming has been for windows, and my target users use windows for now.
I have a lot of code in MFC, some programs will stay there until they die, others I would like to evaluate migrating to other frameworks, to take advantage of what the future brings (mobile, touch, etc). The problem right now I see is that many people are saying that this is dead and that is the futures and so on. Most is marketing but in the end I don't clearly see that MS is giving a long life to MFC. On the other hand, going to WinRT, it feels like as an experiment that could be dropped on the next release as we have seen many times. WxWidgets on the other hand has been for some time, but never tried. I think it will be arround for some years from now.
|
|
|
|
|