Question1:  who can show me an example that how to use dialog box as our main window without RC file.


Question2:what is the advantage of using Rc file?
Posted on 2005-07-28 03:55:11 by Abuseyourdna
Answer 1: that would require DialogBoxIndirect - I think vortex had an example, try looking at http://www.asmcommunity.net/board/index.php?action=search2 . Or, you could take the normal RegisterClass/CreateWindow approach instead of using a dialog box.

Answer 2: the advantage is combined with using a dialog/resource editor, you can layout your windows visually instead of passing values to CreateWindow. Faster visual program layout.
Posted on 2005-07-28 07:14:22 by f0dder

Question1:  who can show me an example that how to use dialog box as our main window without RC file.


Question2:what is the advantage of using Rc file?


Hi,

The RC file is actually just a script that is compiled by the resource compiler into a binary and linked or joined to your program. Any way you might actually create a dialog would require that the information regarding that dialog be stored somewhere and IMHO the best way to do that is within your programs resource section. Technically, it does not matter if you store the DIALOGEX structure in the data section or whether it is incorporated in the resource section however, it is generally advisable to stick with the standard ways of doing things unless circumstances force you to do otherwise as Windows offers a rich set of functions for resources and the extra complexity involved in not using them is alot of overhead.

However, I once played around with incorporating the binary generated with RC.EXE directly into the data section using GoAsm's #includebin directive. I believe there are a few examples of doing this in MASM but it requires specialized programs or something, it is an intrisic function in GoAsm. In the end I got a few few things to work correctly but found the endeavour was more work than it was worth.
Posted on 2005-07-29 00:27:33 by donkey

I believe there are a few examples of doing this in MASM but it requires specialized programs or something, it is an intrisic function in GoAsm.

I wrote a binary file -> .obj object converter a while ago, can be found at http://f0dder.has.it . Could use a revamp and some additional options, but it works fine as is.
Posted on 2005-07-29 00:34:48 by f0dder
i have use RC command to compile the dlg.rc,and it  created a file named dlg.RES,but i dont know how to link it to my program file "dlg.asm".



hint:MASM32 8.0
Posted on 2005-07-29 07:32:13 by Abuseyourdna
using q editor that comes along ??
if yes just create a rsrc.rc file put it in the dir that has your .asm
and then use project --> buildall  it will automatically make .res and link it

btw buildall is a bat file which you can study if you want
take a look at buildall.bat in "your path to masm installtion"\bin folder

if default that would be c:\masm32\bin dir

Posted on 2005-07-29 12:48:18 by bluffer
Hi,

NAME=MyProgram
$(NAME).exe: $(NAME).obj $(NAME).res
        Link /SUBSYSTEM:WINDOWS /LIBPATH:c:\masm32\lib $(NAME).obj $(NAME).res
$(NAME).res: $(NAME).rc
        rc $(NAME).rc
$(NAME).obj: $(NAME).asm
        ml /Sa /Fl /c /coff /Cp $(NAME).asm

Hope this helps,

Darrel
Posted on 2005-07-29 14:11:48 by Darrel
i find a simple way,

1.  RC -v XXX.rc
2. link XXX.RES XXX.OBJ
3.XXX.EXE
finished.
Posted on 2005-07-30 11:14:43 by Abuseyourdna