The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: xandaz on December 14, 2010, 01:10:09 PM

Title: .RC commands
Post by: xandaz on December 14, 2010, 01:10:09 PM
  hi there. Doe anyone know any manual for the .rc commands ? I'm trying to make and RCDATA dword aligned but dont know how. Thanks and  bye
Title: Re: .RC commands
Post by: Vortex on December 14, 2010, 06:18:38 PM
Hi xandaz,

Here is the manual :

\masm32\bin\rc.hlp
Title: Re: .RC commands
Post by: dedndave on December 27, 2010, 05:58:31 PM
mannnnnnn - lol
the rc.hlp file must be for a different version or something
the help-about in the rc.hlp file does not say - it tells me which version of windows i have, though   :P

here is an example from the hlp file
sample MENU
BEGIN
     MENUITEM "&Soup", 100
     MENUITEM "S&alad", 101
     POPUP "&Entree"
     BEGIN
          MENUITEM "&Fish", 200
          MENUITEM "&Chicken", 201, CHECKED
          POPUP "&Beef"
          BEGIN
               MENUITEM "&Steak", 301
               MENUITEM "&Prime Rib", 302
          END
     END
     MENUITEM "&Dessert", 103
END

error - begin expected in menu

here is the same example as it appears on MSDN
sample MENU
     {
     MENUITEM "&Soup", 100
     MENUITEM "S&alad", 101
     POPUP "&Entree"
          {
          MENUITEM "&Fish", 200
          MENUITEM "&Chicken", 201, CHECKED
          POPUP "&Beef"
               {
               MENUITEM "&Steak", 301
               MENUITEM "&Prime Rib", 302
               }
          }
     MENUITEM "&Dessert", 103
     }

same error

if i play around and get rid of the begin error, i get "invalid numeric in checked" - lol
Title: Re: .RC commands
Post by: caseys on December 27, 2010, 06:22:33 PM
im using winasm (http://www.winasm.net/) studio for making .RC config files. nice tool. 
Title: Re: .RC commands
Post by: dedndave on December 27, 2010, 06:32:38 PM
thanks - i have seen that before
one of the members in here (Erol - i think) wrote ResEdit - resource editor
i may give that a shot
Title: Re: .RC commands
Post by: dedndave on December 27, 2010, 06:40:16 PM
actually - i'd like to know how to implement the menus in code   :P
that way, i can change them when the context changes
Title: Re: .RC commands
Post by: Vortex on December 27, 2010, 06:43:48 PM
Hi Dave,

Here is the homepage of RedEdit. ( I am not the author. )

http://www.resedit.net
Title: Re: .RC commands
Post by: dedndave on December 27, 2010, 06:47:07 PM
thanks, Erol   :U
Title: Re: .RC commands
Post by: Victor Stout on December 27, 2010, 08:17:37 PM
Here you go:

1. RC statements. (http://msdn.microsoft.com/en-us/library/aa381043(VS.85).aspx)
2. RC commands. (http://msdn.microsoft.com/en-us/library/aa381055(VS.85).aspx)
Title: Re: .RC commands
Post by: dedndave on December 27, 2010, 08:22:22 PM
thanks Victor
but, apparently, i do not have the version of RC.EXE that they are talking about
just as well - i want to see how some things are done that aren't necessarily done in resource - or at least, not documented
i will probably see something i like in some other program, RE it, and figure out how to do it - lol
it seems a more effective way of learning, as the documentation is a bit disorganized
Title: Re: .RC commands
Post by: dedndave on December 28, 2010, 02:22:09 PM
i found a nice tutorial on "another" forum site   :P

http://www.winprog.org/tutorial/resnotes.html

i think i see where i was going wrong with the example code posted earlier   :lol
Title: Re: .RC commands
Post by: xandaz on December 28, 2010, 10:39:41 PM
   I noticed that there's resource.h circulating in the forum that has DWORD BYTE and etc TYPEDEFs. Can i use this for RCDATA type of resource? From what i understand RCDATA is composed from integers. Can it be done directly with DWORD and BYTE and STRUCTS? Thanks and bye.
Title: Re: .RC commands
Post by: dedndave on December 28, 2010, 10:49:25 PM
that's what it is for
if you mean the one that ~50 Kb - that one is up to date
there are two values that you can look at to see if the one you have is up to date
VOS_WINDOWS32
VFT_APP
those values were not in the old one (and many more, i am sure)
Title: Re: .RC commands
Post by: dedndave on December 29, 2010, 12:35:44 AM
yeah !!!!
i finally got a nested menu to work - lol
now, if i could just get CHECKED and GRAYED to work   :(

            MENUITEM "&Standard", 1032, CHECKED

error...
rsrc.rc (83): error RC2242 : invalid numeric expression at CHECKED

if i replace it with
            MENUITEM "&Standard", 1032
it works
Title: Re: .RC commands
Post by: Gunner on December 29, 2010, 12:55:26 AM
Very strange Dave, I have the following in my RC and it works
MENUITEM "&Open...",IDM_OPEN,CHECKED
Title: Re: .RC commands
Post by: dedndave on December 29, 2010, 12:58:41 AM
here's what i found out
MENU is very different from MENUEX
if using MENU, the MENUITEM statement requires only 2 parms - id, state
if using MENUEX, the MENUITEM statement requires an additional parm - id, type, state

taking a glance through resource.h, i found the types MFT_ and states MFS_ are predefined
so, using MENUEX, this works...
           MENUITEM "&Standard", 1032, MFT_RADIOCHECK, MFS_CHECKED

i know, i know
i win a banana
Title: Re: .RC commands
Post by: dedndave on December 29, 2010, 01:04:14 AM
correction....

it requires you to use the numeric value "MFS_CHECKED", rather than "CHECKED"

i am going to learn resource and manifest files, if it kills me   :P

this also works
           MENUITEM "&Standard", 1032, , MFS_CHECKED
i guess that is a 0
with MFT_RADIOCHECK, it is a round dot
with no parm, it is a check-mark