a rc compiler reports an error "can't read a resource file"
How do you assemble and link ? Because normally you don't need to have a resource section/file
i suppose that the programme doesn't start because there is no an icon in the programme's folder. But i think that there is no need to place an icon in the folder if is a standard one
What exactly are you trying to do ? You don't make much sense (at least to me)
i am trying to create a window. but the programme doesn't start because it can't read from resource file. i suppose it needs an icon itself in the programme's folder. but if the icon is a standard one so it must take an icon from the windows file
What is you program ? How are you linking ? I mean, with which commands ?
i use masm32 v10 there everything goes automatically
If you are working in Quick Editor, the resource file should be named rsrc.rc.
Are you using Qeditor ? Are you using Build All ? Make sure there is no rsrc.rc file in the same folder (if you don't need it)
i downloaded masm32 from masm32.com there separate point in menu "compile resource file"
For the Compile Resource File command to work, there must be a .ASM file loaded into QE, and there must be a resource definition file named rsrc.rc in the current directory.
and how to create this rcrs file?
You don't need to compile a resource file unless you know're gonna use it.
If you want to create a new executable is assembly all you need to do is assemble and link it !! :toothy
but how about an icon? it needs a rc file !
OK, create a rsrc.rc file and paste this in it :
#include "C:\masm32\include\resource.h"
IDR_ICON ICON DISCARDABLE "nameofyouricon.ico"
Change the name to your icon's name. And the folder to your include folder.
i want to use a standard icon
Quote from: andre on September 27, 2009, 04:43:23 PM
i want to use a standard icon
You mean as the executable icon to be shown in windows explorer ? I don't think it's possible, you'll have to rip one from another file to use it.
i think there must be an icon by default which appear in the window
it can be done, but there are drawbacks
for one thing, there is no guarantee that an icon under one OS will have the same ordinal under a different OS (although they will likely match)
also, the explorer.exe file has a number of good icons - same dealeo - no guarantees
Tedd gave us a link that gives you some standard menu icons - use one from there
http://msdn.microsoft.com/en-us/library/bb760433%28VS.85%29.aspx
if you use no icon at all, it will be the default exe icon
if you still want to know how to snag the shell32.dll icons, use the forum search window and look for "shell32.dll icon"
there have been a couple recent related threads
a while back, Erol (Vortex) even showed us how to set the console mode window icon - lol
in examples which were included in masm package there are default icon is included in the programme example folder! i wonder why?
Quote from: andre on September 27, 2009, 05:04:51 PM
in examples which were included in masm package there are default icon is included in the programme example folder! i wonder why?
Uh because there's no point in deleting a 5 kb file when it was there in the first place?
Also a bit off topic: I use IcoFX to rip icons out of .exes and .dlls.
Quote from: dedndave on September 27, 2009, 04:58:01 PMTedd gave us a link that gives you some standard menu icons - use one from there
http://msdn.microsoft.com/en-us/library/bb760433%28VS.85%29.aspx
Aw lol too bad I didn't know that, in a program I made, I ripped and saved all those icons to .ico files and then imported them into my C# project. :\
(why move it now hutch?)
Since you are creating a window and want a default icon, look to RegisterClassEx, specifically the WNDCLASSEX structure...
Quote
hIcon
Handle to the class icon. This member must be a handle to an icon resource. If this member is NULL, the system provides a default icon.
You don't need an icon for you program, windows will give you one.