News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

resource file/icon usage?

Started by p0wder, July 06, 2006, 01:50:42 PM

Previous topic - Next topic

p0wder

I have an icon file called 'mainicon.ico' which I would like to use. It's dimensions are 32x32.

My Make File [.bat]:

set name=test2

C:\masm32\bin\rc /v resource.rc
C:\masm32\bin\cvtres /machine:ix86 resource.RES

C:\masm32\bin\ml /c /coff %name%.asm
C:\masm32\bin\polink /subsystem:CONSOLE %name%.obj resource.obj

if exist *.bak del *.bak
if exist *.obj del *.obj



My resource file:


500 ICON MOVEABLE PURE LOADONCALL DISCARDABLE "mainicon.ico"


The icon is not showing up though, any ideas?



Casper

p0wder,

I have tested your problem and the icon should show.  I think you should put a pause statement at the end of your batch file so you can read carefully and search for reported errors because something is wrong.  If you cannot get it to work, post the project as an attachment and I or someone else will fix it for you.

Casper

Shantanu Gadgil

Why the "cvtres" command? Is it necessary? :red I don't remember using it! :eek :eek
To ret is human, to jmp divine!

Mark Jones

Also there is the possibilty that the icon is incompatible. Try this attached icon.

[attachment deleted by admin]
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

Ossa

rc simply converts from RC to RES format, the cvtres is to convert RES to OBJ. If you use PoLink you can link RES files directly without the conversion. (I think that is correct - but I havn't explored the options for a while).

Ossa
Website (very old): ossa.the-wot.co.uk

Casper

Ossa,
You can do this with link.exe, also.  What polink.exe does is recommend that you not use it if it detects resources in an obj file.  It is entirely unnecessary and if you avoid using it you do not need a unique name for the resource file such as rsrc.rc.  It is better if the rc file can have the same name as the asm file.  In this way, more than one project can exist in the same folder without problems.

Casper.

Ossa

Quote from: Casper on July 07, 2006, 04:07:15 PM
You can do this with link.exe, also.

Didn't know that - thats useful.

Quote from: Casper on July 07, 2006, 04:07:15 PM
It is entirely unnecessary and if you avoid using it you do not need a unique name for the resource file such as rsrc.rc.  It is better if the rc file can have the same name as the asm file.  In this way, more than one project can exist in the same folder without problems.

I have never had this problem as I wrote an add-in for RadASM about three years back that automates the build process. This can handle projects where multiple files get assembled/built to the same intermediate file names. It can also handle multiple output files (make a dynamic (DLL) and static library from the same code during the same build, etc) and can place the intermediate and completed files in arbitrary locations. I dislike fiddling with batch files and prefer a GUI type thing... see this... anyway, that was a bit off topic, sorry.

Ossa
Website (very old): ossa.the-wot.co.uk