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. - IDR_ACCELERATOR1 ACCELERATORS
-
BEGIN
-
VK_F4, ID_ACC_F4, VIRTKEY, NOINVERT
-
VK_RETURN, ID_ACC_ENTER, VIRTKEY, NOINVERT
-
END
I'm getting a parse error for the line after BEGIN.
18 3916 Rabbit 12,516
Recognized Expert Moderator MVP
Just thought I'd give this a bump.
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.
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.
Rabbit 12,516
Recognized Expert Moderator MVP 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.
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.
Rabbit 12,516
Recognized Expert Moderator MVP Accelerator Resources
The link is to a thread that I haven't received a response to. Thanks.
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.
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?
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.
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.
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.
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 -
VK_F4, ID_ACC_F4, VIRTKEY, NOINVERT
-
VK_RETURN, ID_ACC_ENTER, VIRTKEY, NOINVERT
-
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?
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.
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. - // Microsoft Visual C++ generated resource script.
-
//
-
#include "resource.h"
-
-
#define APSTUDIO_READONLY_SYMBOLS
-
/////////////////////////////////////////////////////////////////////////////
-
//
-
// Generated from the TEXTINCLUDE 2 resource.
-
//
-
#include "afxres.h"
-
-
/////////////////////////////////////////////////////////////////////////////
-
#undef APSTUDIO_READONLY_SYMBOLS
-
-
/////////////////////////////////////////////////////////////////////////////
-
// English (U.S.) resources
-
-
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
-
#ifdef _WIN32
-
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
-
#pragma code_page(1252)
-
#endif //_WIN32
-
-
#ifdef APSTUDIO_INVOKED
-
/////////////////////////////////////////////////////////////////////////////
-
//
-
// TEXTINCLUDE
-
//
-
-
1 TEXTINCLUDE
-
BEGIN
-
"resource.h\0"
-
END
-
-
2 TEXTINCLUDE
-
BEGIN
-
"#include ""afxres.h""\r\n"
-
"\0"
-
END
-
-
3 TEXTINCLUDE
-
BEGIN
-
"\r\n"
-
"\0"
-
END
-
-
#endif // APSTUDIO_INVOKED
-
-
-
/////////////////////////////////////////////////////////////////////////////
-
//
-
// Bitmap
-
//
-
-
IDB_BITMAP1 BITMAP "portscanskin.bmp"
-
-
/////////////////////////////////////////////////////////////////////////////
-
//
-
// Icon
-
//
-
-
// Icon with lowest ID value placed first to ensure application icon
-
// remains consistent on all systems.
-
IDI_ICON1 ICON "icon1.ico"
-
IDI_ICON2 ICON "icon2.ico"
-
-
/////////////////////////////////////////////////////////////////////////////
-
//
-
// Accelerator
-
//
-
-
IDR_ACCELERATOR1 ACCELERATORS
-
BEGIN
-
VK_F4, ID_ACC_F4, VIRTKEY, NOINVERT
-
VK_RETURN, ID_ACC_ENTER, VIRTKEY, NOINVERT
-
END
-
-
#endif // English (U.S.) resources
-
/////////////////////////////////////////////////////////////////////////////
-
-
-
-
#ifndef APSTUDIO_INVOKED
-
/////////////////////////////////////////////////////////////////////////////
-
//
-
// Generated from the TEXTINCLUDE 3 resource.
-
//
-
-
-
/////////////////////////////////////////////////////////////////////////////
-
#endif // not APSTUDIO_INVOKED
-
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. -
#ifdef APSTUDIO_INVOKED
-
#ifndef APSTUDIO_READONLY_SYMBOLS
-
#define _APS_NEXT_RESOURCE_VALUE 108
-
#define _APS_NEXT_COMMAND_VALUE 40008
-
#define _APS_NEXT_CONTROL_VALUE 1001
-
#define _APS_NEXT_SYMED_VALUE 112
-
#endif
-
#endif
-
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.
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. -
#ifdef APSTUDIO_INVOKED
-
#ifndef APSTUDIO_READONLY_SYMBOLS
-
#define _APS_NEXT_RESOURCE_VALUE 108
-
#define _APS_NEXT_COMMAND_VALUE 40008
-
#define _APS_NEXT_CONTROL_VALUE 1001
-
#define _APS_NEXT_SYMED_VALUE 112
-
#endif
-
#endif
-
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.
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
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.
Sign in to post your reply or Sign up for a free account.
Similar topics |
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...
|
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...
|
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?
...
|
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...
|
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...
| |
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...
|
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...
|
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...
|
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...
|
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...
|
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,...
| |
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...
|
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...
|
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...
|
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,...
|
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...
|
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...
| |
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 ...
| |