Resource editor - ResEdit behaviour

  • (2 Pages)
  • +
  • 1
  • 2

15 Replies - 4846 Views - Last Post: 22 January 2012 - 12:12 PM

#1 norman1312  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 62
  • Joined: 08-September 11

Resource editor - ResEdit behaviour

Posted 12 January 2012 - 03:58 AM

In a previous post I asked about Resource Editors to use with Visual C++ 2010 Express and I was pointed in the direction of ResEdit. This worked for me and I was able to modify my .rc file to get the results I wanted. However, every time I started it I was asked for the include files to use with it. I originally found three that seemed to make it work, but I could not find any way to save this information. Emails (multiple) to the address on the site have gone unanswered which is why I am turning to the forum to help.
I am now working on another program and also need to modify the .rc file. For some reason now I can still find three include files, but when I load the resource file I get an error about EDITTEXT as shown in the attachment.
The very curious problem is that a previous program's resource file is full of EDITTEXT's and that worked quite happily when I was modifying the layout of the dialog. So what changed, I simply don't know.
If I can find an include file to work, is it possible to save that information somehow?
Does anyone know how I go from here?

Attached image(s)

  • Attached Image
  • Attached Image


Is This A Good Question/Topic? 0
  • +

Replies To: Resource editor - ResEdit behaviour

#2 GunnerInc  Icon User is offline

  • "Hurry up and wait"
  • member icon




Reputation: 858
  • View blog
  • Posts: 2,277
  • Joined: 28-March 11

Re: Resource editor - ResEdit behaviour

Posted 12 January 2012 - 05:03 PM

What does your rc file look like?

Inside one of those include directories, you should have a file called RESOURCE.h if not, find it on your drive and add that directory to the include paths.

and at the top of your rc file, you should have
#include <windows.h>
#include <commctrl.h>
#include <richedit.h>
#include "resource.h" Yes?

You could try XN Resource Editor works well.

Or the one that I use that is part of the IDE I use:
RedEd

This post has been edited by GunnerInc: 12 January 2012 - 05:06 PM

Was This Post Helpful? 0
  • +
  • -

#3 norman1312  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 62
  • Joined: 08-September 11

Re: Resource editor - ResEdit behaviour

Posted 13 January 2012 - 02:38 AM

Quite correct. The header of the .rc file reads

#include <windows.h>
#include <commctrl.h>
#include <richedit.h>
#include "resource.h"


I've installed XN. That fails with 'Unknown directive #elif'. That's not in MY code.
Installed ResEd. That fails with 'Unknown style in IDD_DIALOG4'. That looks like:
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
IDD_DIALOG4 DIALOG 0, 0, 283, 95
STYLE DS_3DLOOK | DS_CENTER | DS_MODALFRAME | DS_SHELLFONT | WS_CAPTION | WS_VISIBLE | WS_POPUP | WS_SYSMENU


When I click on the Help I get nothing at all. Where is it? I'm going to delete them one at a time to see what it's complaining about, but that's not nice is it? All the others I've tried never complained about the style!
Not having much luck, am I?
Was This Post Helpful? 0
  • +
  • -

#4 GunnerInc  Icon User is offline

  • "Hurry up and wait"
  • member icon




Reputation: 858
  • View blog
  • Posts: 2,277
  • Joined: 28-March 11

Re: Resource editor - ResEdit behaviour

Posted 20 January 2012 - 05:53 PM

You tried opening a resource file in ResEdit from the link I gave? It said "'Unknown style in IDD_DIALOG4'" It means exactly that, IDD_DIALOG4 is not defined. At the top of most resource files are a bunch of #defines, seems you are missing that.

I created a new rc file and added a dialog, this is what the rc file looks like:
#define IDD_DLG1 1000

IDD_DLG1 DIALOGEX 10,10,150,100
CAPTION "IDD_DLG"
FONT 8,"MS Sans Serif",0,0,0
STYLE WS_VISIBLE|WS_OVERLAPPEDWINDOW
BEGIN
END


Resource editors will use those defines for the ID numbers for the controls/dialogs and the resource compilers will replace IDD_DLG1 with 1000.

I could easily not use defines and enter the numbers directly:
1000 DIALOGEX 10,10,150,100
CAPTION "IDD_DLG"
FONT 8,"MS Sans Serif",0,0,0
STYLE WS_VISIBLE|WS_OVERLAPPEDWINDOW
BEGIN
END

This is the same as the first sample but without a define

Try adding #define IDD_DIALOG4 SomeNumberHere at the top of the rc file and see what happens.
Was This Post Helpful? 0
  • +
  • -

#5 norman1312  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 62
  • Joined: 08-September 11

Re: Resource editor - ResEdit behaviour

Posted 21 January 2012 - 11:56 AM

ResEdit doesn't work. I got that error from ResEd.
Sorry, this is an extract from resource.h:

#define IDD_DIALOG3                             113
#define IDD_DIALOG4                             114
#define IDD_DIALOG5                             115
#define IDD_DIALOG6                             116
#define IDD_DIALOG7                             117




I have added it to the rc file and it made no difference at all!
Was This Post Helpful? 0
  • +
  • -

#6 GunnerInc  Icon User is offline

  • "Hurry up and wait"
  • member icon




Reputation: 858
  • View blog
  • Posts: 2,277
  • Joined: 28-March 11

Re: Resource editor - ResEdit behaviour

Posted 21 January 2012 - 01:56 PM

Norman, please attach the complete rc file or email it to me. There is something wrong somewhere in the file, and posting bits and pieces is of no help to either of us.
Was This Post Helpful? 0
  • +
  • -

#7 GunnerInc  Icon User is offline

  • "Hurry up and wait"
  • member icon




Reputation: 858
  • View blog
  • Posts: 2,277
  • Joined: 28-March 11

Re: Resource editor - ResEdit behaviour

Posted 21 January 2012 - 03:14 PM

Ok, thanks for the file. There was an error in it!

Look at line 71:
EDITTEXT        IDC_EDIT1, 11, 23, 36, 18, ES_AUTOHSCROLL,


see that comma at the end of the line? That should not be there! Remove the comma and it will open in your resource editor of choice! It now opens in any resouce editor I tried when I removed the comma! :eek:
Was This Post Helpful? 1
  • +
  • -

#8 norman1312  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 62
  • Joined: 08-September 11

Re: Resource editor - ResEdit behaviour

Posted 21 January 2012 - 03:53 PM

And so it does!
So, can you answer the other half of the initial question?
Using ResEdit, is there any way to save the include files that it asks for when you start up?
Was This Post Helpful? 0
  • +
  • -

#9 GunnerInc  Icon User is offline

  • "Hurry up and wait"
  • member icon




Reputation: 858
  • View blog
  • Posts: 2,277
  • Joined: 28-March 11

Re: Resource editor - ResEdit behaviour

Posted 21 January 2012 - 06:12 PM

Each time you run ResEdit, in the settings dialog the paths you entered once are not there? Did you select "Apply" after you made changes?

What OS are you using? Open ResEdit.xml, are your include paths there?
The section should look like:
    <includes>
        <include path="D:\SDK Stuff\Windows\v6.0\Include\" />
        <include path="D:\WinDDK\7600.16385.1\inc\api\" />
    </includes>


Of course the paths will be to your include directories. If not, add them in the above format.
Was This Post Helpful? 0
  • +
  • -

#10 norman1312  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 62
  • Joined: 08-September 11

Re: Resource editor - ResEdit behaviour

Posted 22 January 2012 - 04:08 AM

For the paths I use look at the attachment to the very first post in this thread.
I have tried the 'Apply' button after selecting them, but on the next call it still asks for the include files, so it doesn't seem to store them (as far as I can tell!) And if I say no, it simply can't find the includes that the resource file needs. So that makes using it VERY annoying.
On a slightly tangental note, it's interesting that the VC++ compiler doesn't object to that comma, whereas everything else does!
Was This Post Helpful? 0
  • +
  • -

#11 GunnerInc  Icon User is offline

  • "Hurry up and wait"
  • member icon




Reputation: 858
  • View blog
  • Posts: 2,277
  • Joined: 28-March 11

Re: Resource editor - ResEdit behaviour

Posted 22 January 2012 - 09:40 AM

Quote

it's interesting that the VC++ compiler doesn't object to that comma, whereas everything else does!

Every other resource editor conforms to standards. MS products don't seem to follow industry standards, instead they feel the need to make up their own and expect others to conform to theirs. VS probably skips the errors before passing the file to rc.

I will ask again:
Did you open the settings file: ResEdit.xml are your include path in there?

Is the file RESOURCE.H in one of those include directories? notice the file is in all uppercase, it is different than the resource.h file in your resource file directory.

This post has been edited by GunnerInc: 22 January 2012 - 09:41 AM

Was This Post Helpful? 0
  • +
  • -

#12 norman1312  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 62
  • Joined: 08-September 11

Re: Resource editor - ResEdit behaviour

Posted 22 January 2012 - 10:34 AM

Why am I not surprised.
I have opened the xml file. The includes are NOT in the file.
I attach the listing of most of the xml file. See how the resource file header is defined.
The file is named Resource.h in the project directory, so I can only guess just what "%RESOURCE_HEADER%" %RESOURCES% means.
So where do I go from here?

Attached image(s)

  • Attached Image

Was This Post Helpful? 0
  • +
  • -

#13 GunnerInc  Icon User is offline

  • "Hurry up and wait"
  • member icon




Reputation: 858
  • View blog
  • Posts: 2,277
  • Joined: 28-March 11

Re: Resource editor - ResEdit behaviour

Posted 22 January 2012 - 10:40 AM

Your include section is empty for some reason - <includes/> see my post #9 up there? That is how your include section should look. add your path to the include section.

Replace:
<Includes/>

with:
<includes>
<include path="D:\SDK Stuff\Windows\v6.0\Include\" />
<include path="D:\WinDDK\7600.16385.1\inc\api\" />
</includes>
replace the paths with your paths to your include files.

Oh, and the stuff in CDATA? Those are things that get automagically added to the top of your resource files.

This post has been edited by GunnerInc: 22 January 2012 - 10:42 AM

Was This Post Helpful? 1
  • +
  • -

#14 norman1312  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 62
  • Joined: 08-September 11

Re: Resource editor - ResEdit behaviour

Posted 22 January 2012 - 11:54 AM

I've done that and the first attempt didn't work until I noticed that the entry in xml file read <includes />.
I've corrected that to be <includes> .... </includes> and that now works.
I can now see the resource file with all its content, so that solves that annoying problem.
The question must be: why didn't the program incorporate the includes into the xml file?
Was This Post Helpful? 0
  • +
  • -

#15 GunnerInc  Icon User is offline

  • "Hurry up and wait"
  • member icon




Reputation: 858
  • View blog
  • Posts: 2,277
  • Joined: 28-March 11

Re: Resource editor - ResEdit behaviour

Posted 22 January 2012 - 11:56 AM

Dunno, If a tree falls in the woods and nobody is around, does it make a noise? LOL

Probably a permission issue. Where is the ResEdit folder located? What OS version?
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2