473,512 Members | 14,457 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Accelerator Resources

Rabbit
12,516 Recognized Expert Moderator MVP
Okay, so the tutorial I'm using is creating Accelerator (Keyboard shortcuts) resources using Visual C++. I'm using DevC++ and was unable to find a similar function in their resource editor. So what I did was copy that part of his resource file.
Expand|Select|Wrap|Line Numbers
  1. IDR_ACCELERATOR1 ACCELERATORS 
  2. BEGIN
  3.     VK_F4,          ID_ACC_F4,              VIRTKEY, NOINVERT
  4.     VK_RETURN,      ID_ACC_ENTER,           VIRTKEY, NOINVERT
  5. END
I'm getting a parse error for the line after BEGIN.
Apr 6 '07 #1
18 3916
Rabbit
12,516 Recognized Expert Moderator MVP
Just thought I'd give this a bump.
Apr 9 '07 #2
Peterwkc
55 New Member
I don't understand what you doing here because i am a newbie. I would like to learn from you.

Thanks for oyur explanation.


Your help is greatly appreciated by me and others.
Apr 11 '07 #3
Rabbit
12,516 Recognized Expert Moderator MVP
I've been looking on google but I've yet to find anything useful.

I tried copying over the tutorial's source files but I had to remove a lot of the stuff in resouce file that he didn't include in his files. I still got a parse error on that line.
Apr 12 '07 #4
Rabbit
12,516 Recognized Expert Moderator MVP
Bumping the thread.
Apr 16 '07 #5
Rabbit
12,516 Recognized Expert Moderator MVP
I'm not sure if there's no replies because no one knows the answer or because everyone thinks I'm already getting helped because of how many replies there are.
Apr 18 '07 #6
Rabbit
12,516 Recognized Expert Moderator MVP
I'm gonna post another thread linking this one because I don't think anyone's actually looking at this thread.
Apr 25 '07 #7
Rabbit
12,516 Recognized Expert Moderator MVP
Accelerator Resources

The link is to a thread that I haven't received a response to. Thanks.
Apr 25 '07 #8
RedSon
5,000 Recognized Expert Expert
I wasn't looking at this thread until I saw a double post! Shame, shame, Rabbit you should know better!

I suspect that DevC++ or whatever you are using doesn't know what VK_F4 is and that is your problem.
Apr 25 '07 #9
RedSon
5,000 Recognized Expert Expert
Another thought occurs to me... have you compared the resource files of Visual Studio with the resource files of whatever you are looking at? Perhaps the syntax is slightly different. Or is Dev c++ strictly an IDE?
Apr 25 '07 #10
Rabbit
12,516 Recognized Expert Moderator MVP
I wasn't looking at this thread until I saw a double post! Shame, shame, Rabbit you should know better!

I suspect that DevC++ or whatever you are using doesn't know what VK_F4 is and that is your problem.
LOL, had to get attention for the unnoticed thread.

At least I waited half a month before double posting :)

I thought it may be that the syntax is different across the IDEs but I couldn't find an example for DevC++ so I really have no idea which part of the syntax is wrong.
Apr 25 '07 #11
Rabbit
12,516 Recognized Expert Moderator MVP
Another thought occurs to me... have you compared the resource files of Visual Studio with the resource files of whatever you are looking at? Perhaps the syntax is slightly different. Or is Dev c++ strictly an IDE?
As far as I can tell, the syntax is the same for the most part, i.e. I copied the Visual C++ resource file and it likes most of it except for a couple of things.

1) The accerlerator syntax

2) There are some Includes in the Visual C++ Resource file that were not included in the tutorial package so I removed those, in which case everything works except for the Accelerators.

Only conclusion I can make is either the DevC++ syntax is different or those include files were Visual C++ only and were needed for the accelerators to work.

Edit: As far as I can tell from other examples I found online, they used the same syntax as the Visual C++. Unless of course all the examples were using Visual C++ lol.
Apr 25 '07 #12
RedSon
5,000 Recognized Expert Expert
As far as I can tell, the syntax is the same for the most part, i.e. I copied the Visual C++ resource file and it likes most of it except for a couple of things.

1) The accerlerator syntax

2) There are some Includes in the Visual C++ Resource file that were not included in the tutorial package so I removed those, in which case everything works except for the Accelerators.

Only conclusion I can make is either the DevC++ syntax is different or those include files were Visual C++ only and were needed for the accelerators to work.

Edit: As far as I can tell from other examples I found online, they used the same syntax as the Visual C++. Unless of course all the examples were using Visual C++ lol.
So does DevC++ have resource editors? If so can you make a new res and see what it looks like. Its gotta be that DevC++ doesnt understand what some of those constants are.
Apr 26 '07 #13
Banfa
9,065 Recognized Expert Moderator Expert
I have merged the threads so that this thread has it's context.

lets start with the basics in the line

Expand|Select|Wrap|Line Numbers
  1.     VK_F4,          ID_ACC_F4,              VIRTKEY, NOINVERT
  2.     VK_RETURN,      ID_ACC_ENTER,           VIRTKEY, NOINVERT
  3.  
VK_F4 is defined in the windows headers (winuser.h) and VIRTKEY and NOINVERT are keywords used by the resource compiler.

ID_ACC_F4 is a symbol that must be #defined by you in a header somewhere.

So are you sure that you have defined ID_ACC_F4 somewhere and that that file is #included into the resource file?
Apr 26 '07 #14
Rabbit
12,516 Recognized Expert Moderator MVP
So does DevC++ have resource editors? If so can you make a new res and see what it looks like. Its gotta be that DevC++ doesnt understand what some of those constants are.
Yes DevC++ has a resource editor but it doesn't have an option to create an accelerator like Visual C++ does.
Apr 26 '07 #15
Rabbit
12,516 Recognized Expert Moderator MVP
The only difference from my source files and the tutorial's source files is the resource file and the resource.h file.

Below is the tutorials resource file. I #included "resource.h" in mines as well. I excluded everything after that until the the bitmap because 1) I have no idea what afxres.h was, it was never included in the tutorial files and the tutorial never went over it and 2) The same goes for all the APS Studio stuff.

I included everything from the bitmap to the accelerators. Everything after that doesn't seem to do anything anyways. Everything else works except for the accelerators.
Expand|Select|Wrap|Line Numbers
  1. // Microsoft Visual C++ generated resource script.
  2. //
  3. #include "resource.h"
  4.  
  5. #define APSTUDIO_READONLY_SYMBOLS
  6. /////////////////////////////////////////////////////////////////////////////
  7. //
  8. // Generated from the TEXTINCLUDE 2 resource.
  9. //
  10. #include "afxres.h"
  11.  
  12. /////////////////////////////////////////////////////////////////////////////
  13. #undef APSTUDIO_READONLY_SYMBOLS
  14.  
  15. /////////////////////////////////////////////////////////////////////////////
  16. // English (U.S.) resources
  17.  
  18. #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
  19. #ifdef _WIN32
  20. LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
  21. #pragma code_page(1252)
  22. #endif //_WIN32
  23.  
  24. #ifdef APSTUDIO_INVOKED
  25. /////////////////////////////////////////////////////////////////////////////
  26. //
  27. // TEXTINCLUDE
  28. //
  29.  
  30. 1 TEXTINCLUDE 
  31. BEGIN
  32.     "resource.h\0"
  33. END
  34.  
  35. 2 TEXTINCLUDE 
  36. BEGIN
  37.     "#include ""afxres.h""\r\n"
  38.     "\0"
  39. END
  40.  
  41. 3 TEXTINCLUDE 
  42. BEGIN
  43.     "\r\n"
  44.     "\0"
  45. END
  46.  
  47. #endif    // APSTUDIO_INVOKED
  48.  
  49.  
  50. /////////////////////////////////////////////////////////////////////////////
  51. //
  52. // Bitmap
  53. //
  54.  
  55. IDB_BITMAP1             BITMAP                  "portscanskin.bmp"
  56.  
  57. /////////////////////////////////////////////////////////////////////////////
  58. //
  59. // Icon
  60. //
  61.  
  62. // Icon with lowest ID value placed first to ensure application icon
  63. // remains consistent on all systems.
  64. IDI_ICON1               ICON                    "icon1.ico"
  65. IDI_ICON2               ICON                    "icon2.ico"
  66.  
  67. /////////////////////////////////////////////////////////////////////////////
  68. //
  69. // Accelerator
  70. //
  71.  
  72. IDR_ACCELERATOR1 ACCELERATORS 
  73. BEGIN
  74.     VK_F4,          ID_ACC_F4,              VIRTKEY, NOINVERT
  75.     VK_RETURN,      ID_ACC_ENTER,           VIRTKEY, NOINVERT
  76. END
  77.  
  78. #endif    // English (U.S.) resources
  79. /////////////////////////////////////////////////////////////////////////////
  80.  
  81.  
  82.  
  83. #ifndef APSTUDIO_INVOKED
  84. /////////////////////////////////////////////////////////////////////////////
  85. //
  86. // Generated from the TEXTINCLUDE 3 resource.
  87. //
  88.  
  89.  
  90. /////////////////////////////////////////////////////////////////////////////
  91. #endif    // not APSTUDIO_INVOKED
  92.  
The only difference between our resource.h files is that the tutorial has the following at the bottom of the file. Again I have no idea as to its function.
Expand|Select|Wrap|Line Numbers
  1. #ifdef APSTUDIO_INVOKED
  2. #ifndef APSTUDIO_READONLY_SYMBOLS
  3. #define _APS_NEXT_RESOURCE_VALUE        108
  4. #define _APS_NEXT_COMMAND_VALUE         40008
  5. #define _APS_NEXT_CONTROL_VALUE         1001
  6. #define _APS_NEXT_SYMED_VALUE           112
  7. #endif
  8. #endif
  9.  
Everything I removed already existed long before the tutorial started on Accelerators and I removed them at that time as well to no ill effect.

The tutorial files also have a couple of .ncb, .suo, .sln, and .aps files that I don't know the purpose of.
Apr 26 '07 #16
Banfa
9,065 Recognized Expert Moderator Expert
The only difference between our resource.h files is that the tutorial has the following at the bottom of the file. Again I have no idea as to its function.
Expand|Select|Wrap|Line Numbers
  1. #ifdef APSTUDIO_INVOKED
  2. #ifndef APSTUDIO_READONLY_SYMBOLS
  3. #define _APS_NEXT_RESOURCE_VALUE        108
  4. #define _APS_NEXT_COMMAND_VALUE         40008
  5. #define _APS_NEXT_CONTROL_VALUE         1001
  6. #define _APS_NEXT_SYMED_VALUE           112
  7. #endif
  8. #endif
  9.  
Everything I removed already existed long before the tutorial started on Accelerators and I removed them at that time as well to no ill effect.

The tutorial files also have a couple of .ncb, .suo, .sln, and .aps files that I don't know the purpose of.
Humpff, I seem to remember talking to you about these #defines before, they should not be the problem.

The .ncb and .aps files are produced by MS DevStudio to hold the state of the project (which files are open, things like that) the .suo and .sln are the files that define the project (a bit like make files) so non of them should be required by Dev C++ which should have its own version of them.
Apr 26 '07 #17
Banfa
9,065 Recognized Expert Moderator Expert
Just found this on SourceForge.net (although it is a bit old), seems you are not the only person to have had problems with the resource compiler (assuming you are using windres)

Email Archive: mingw-users (read-only)

[Mingw-users] [mingw - Windows API] RE: windres can't parse my resource correctly
From: SourceForge.net <noreply@so...> - 2005-08-06 20:45
Read and respond to this message at:
https://sourceforge.net/forum/message.php?msg_id=3283395
By: ross_ridge

> is any windres option to avoid this problem?

Not that I'm aware of. There's a lot of problems with windres and it's
internationalization support seems to be pretty much hopeless. I've had better
luck using Microsoft's resource compiler (included free in the Platform SDK)
and using windres to convert the compiled resource files (.RES) in to COFF object
files that the GNU linker can deal with.
Though that doesn't always work either.

Ross Ridge
Apr 26 '07 #18
Rabbit
12,516 Recognized Expert Moderator MVP
Humpff, I seem to remember talking to you about these #defines before, they should not be the problem.

The .ncb and .aps files are produced by MS DevStudio to hold the state of the project (which files are open, things like that) the .suo and .sln are the files that define the project (a bit like make files) so non of them should be required by Dev C++ which should have its own version of them.
Right, so everything I removed I had removed way before accelerators came into play. So I can only assume that the problem is either the syntax is different from Visual C++ and DevC++ or DevC++ does not support accelerators but they seem to be such an important part of window's that I can't really believe that's the issue. Maybe I'll have to contact the DevC++ team.
Apr 26 '07 #19

Sign in to post your reply or Sign up for a free account.

Similar topics

5
3754
by: Nick Bartos | last post by:
I am looking for an open source php accelerator that works in cgi mode. I am guessing that to do that the cache would have to be on disk and not in memory. I was looking at the turk accelerator...
0
1498
by: | last post by:
I have not used a php accelerator besides the free version of zend's offering. I am looking for opinions on the best performer out there. Price is really not a problem... I just need to look at...
0
1533
by: Deke | last post by:
I could not find a Zend PHP Accelerator Engine for Solaris X86. The faq says it is available but could not find it anywhere on the site. Does one one know about such a port? Any one use one? ...
2
2609
by: Richard | last post by:
Is there a way to duplicate the accelerator key for controls which live on separate pages of a tab control. i.e. to have a button called &Button1 on one tab and another button called &Button2 on...
1
2338
by: BruceR | last post by:
I have created an Outlook style bar in my C# application and have associated accelerator keys to my group/icon buttons by using the & key and setting UseMnemonic as appropriate. The problem is that...
1
3465
by: Csaba Gabor | last post by:
Short version: if the user types an alt+ctrl+char combination which leads to a defined character, but s/he's not in a input(text)/textarea, then I'd like that keystroke combination to do the same...
2
2506
by: Richard Lewis Haggard | last post by:
How does one specify the Escape key as an accelerator? My client has specified that the Escape key be used as an accelerator for a particular menu item. In VS05's designer mode, this particular...
2
2403
by: B. | last post by:
I have a C# winform with accelerator key associated with some menus. If my exe is in unmanaged C++ and the winform is invoked through interop, the accelerator key not working. If I create a new...
2
3206
by: killy971 | last post by:
I have been testing different libraries to process XSL transformations on large XML files. The fact is that I read a document from Intel, stating their library (XSLT accelerator) was more twice...
0
7153
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7373
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7432
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7094
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7519
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5677
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4743
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3230
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1585
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.