The MASM Forum Archive 2004 to 2012

Project Support Forums => GoAsm Assembler and Tools => Topic started by: Citric on January 29, 2005, 01:26:52 PM

Title: A Dialog as the Main Window. Unable to find the resource.
Post by: Citric on January 29, 2005, 01:26:52 PM
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]
Title: Re: A Dialog as the Main Window. Unable to find the resource.
Post by: petezl on January 29, 2005, 02:58:15 PM
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.
Title: Re: A Dialog as the Main Window. Unable to find the resource.
Post by: Citric on January 30, 2005, 01:59:40 AM
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.
Title: Re: A Dialog as the Main Window. Unable to find the resource.
Post by: petezl on January 30, 2005, 10:03:14 AM
Sorry I could'nt help. I don't understand Goasm syntax.
Peter.
Title: Re: A Dialog as the Main Window. Unable to find the resource.
Post by: jorgon on January 30, 2005, 06:02:08 PM
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.

Title: Re: A Dialog as the Main Window. Unable to find the resource.
Post by: jorgon on February 02, 2005, 11:17:14 AM
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 (http://www.godevtool.com/gorcjorg").

Jeremy
Title: Re: A Dialog as the Main Window. Unable to find the resource.
Post by: Citric on February 03, 2005, 02:56:32 AM
Sweet Jorgon.

I will grab it when i get home.

Adam  :U