The MASM Forum Archive 2004 to 2012

General Forums => The Workshop => Topic started by: Warmt on February 21, 2008, 05:37:16 PM

Title: Problem with .rc
Post by: Warmt on February 21, 2008, 05:37:16 PM
Hi guys.

At the moment I've got the following problem:

In my resource file (rsrc.rc) I've definied some bitmap buttons which I want to use in my program.
I defined them this way:

2000 BITMAP MOVEABLE PURE LOADONCALL DISCARDABLE "stuff\run_btn.bmp"
2001 BITMAP MOVEABLE PURE LOADONCALL DISCARDABLE "stuff\quit_btn.bmp"
2002 BITMAP MOVEABLE PURE LOADONCALL DISCARDABLE "stuff\info_btn.bmp"
2003 BITMAP MOVEABLE PURE LOADONCALL DISCARDABLE "stuff\music_btn.bmp"


Everything worked fine when I only had the last 3 buttons in my program (ID 2001 - 2003)
A few minutes ago I wanted to add one more (ID 2000).
However when I now compile my project (with the makeit.bat), I get the following error:

un_btn.bmp5): error RC2135 : file not found: stuff
CVTRES : fatal error CVT1101: cannot open rsrc.res for reading


Thats EXACTLY what it's showing.
Instead of "run_btn.bmp" it shows "un_btn.bmp" (without the "r").

Well, I'm more worried about why exactly it cannot find the file (even though its there too 100%
[the filename is the same as in the .rc (with the "r"]) than about the missing "r" of course.

Seeing that it works fine with the other .bmp's I'd like to know why exactly masm gives me this error.

Could anyone please help?
Title: Re: Problem with .rc
Post by: ragdog on February 21, 2008, 05:56:13 PM
hi

try this i hope its helps you


5000  BITMAP    DISCARDABLE "Res/logo.bmp"

res is your folder to add the bitmaps

and show your slash signs

stuff\music_btn.bmp to stuff/music_btn.bmp

greets
Title: Re: Problem with .rc
Post by: ToutEnMasm on February 21, 2008, 06:39:26 PM
Special path notation for rc files
2000 BITMAP MOVEABLE PURE LOADONCALL DISCARDABLE "stuff\\run_btn.bmp"
and all is good
Title: Re: Problem with .rc
Post by: Warmt on February 21, 2008, 06:42:24 PM
Thats odd now..

added
5000 BITMAP DISCARDABLE "stuff/run_btn.bmp"
to the .rc file, compiled, and it worked.

Then I changed the line again to:
2000 BITMAP MOVEABLE PURE LOADONCALL DISCARDABLE "stuff\run_btn.bmp"
compiled, and it worked..

asm can be really weird sometimes ;)

btw, the slash signs ( / or \ ) doesnt seem to matter at all, since they also worked
on the other .bmps.

Anyway, it works now, thanks for your help, ragdog, I really appreciate it.

Also thanks for your tip, ToutEnMasm. I'll keep that in mind if the same thing happens again.
Title: Re: Problem with .rc
Post by: GregL on February 21, 2008, 06:56:16 PM
The reason is that .rc files use C syntax.

Title: Re: Problem with .rc
Post by: Tedd on February 22, 2008, 12:45:07 PM
\r \n \t \a \b ... all have special meanings. Using \\ has the special meaning of the \ character, or just use / which seems to work just as well.
Title: Re: Problem with .rc
Post by: Warmt on February 23, 2008, 04:41:28 PM
Thanks for your help guys.

I suppose this topic can be closed now.