A Dialog as the Main Window. Unable to find the resource.

Started by Citric, January 29, 2005, 01:26:52 PM

Previous topic - Next topic

Citric

Hi

I have adapted a small program from Iczelion's tutorial 10 part 2. The name of my dialog matches up to the call to DialogBoxParam, but when i debug the program i get an error stating that the resource could not be found. I have tried a few things but can not find the problem.

please have a look at the source code attached and let me know where i have gone wrong.

any Help is appreciated.

Citric  :U

[attachment deleted by admin]

petezl

hi Citric,
I haven't ried it but your bat file shows "r dialog.rc" instead of dialog.rc. Just a typo I expect.
Peter.
Cats and women do as they please
Dogs and men should realise it.

Citric

Hi Petezl

I think the line you are replying about is "GoRC /r dialog.rc".
The /r is there so GoRC outputs a .res. which is then linked in.

Thanks for the reply
Adam.

petezl

Sorry I could'nt help. I don't understand Goasm syntax.
Peter.
Cats and women do as they please
Dogs and men should realise it.

jorgon

Hi Citric

Your problem lies in the resource file, in that the dialog contains a menu with an ID that is obtained from a definition instead of being given directly (by name or number).  If you replace the IDR_MENU1 with a number such as your 3003 or a name such as MyMenu then your code works ok.

GoRC does support evaluation of MENU IDs for a MENU resource but not MENU IDs when a menu is specified for a dialog, which is why your code also works if you simply delete the #define IDR_MENU1 3003 line.  Then GoRC assumes you have named the menu IDR_MENU1 and within the dialog also specified the menu by that name.

Perhaps when I wrote GoRC I should have added this feature, since I now see it is allowed by Microsoft's RC.exe, something which passed me by at the time.  I've made a note of the omission and intend to add this to GoRC on the next release.

Personally I usually don't use defines and as you can see the define in this case is redundant, since you can simply use the name IDR_MENU1 directly.  However, I am very much aware that a lot of people use them all the time for one reason or another, and of course there is a lot of sample code out there using them.

Thanks for pointing this out to me.

Author of the "Go" tools (GoAsm, GoLink, GoRC, GoBug)

jorgon

Citric

I had to update GoRC to fix something else, so I took the opportunity to add support for definitions to in the MENU statement in a DIALOG resource.
You can download the new GoRC (version 0.88) from here.

Jeremy
Author of the "Go" tools (GoAsm, GoLink, GoRC, GoBug)

Citric