flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > Resource macros

Author
Thread Post new topic Reply to topic
kaafe



Joined: 15 Oct 2003
Posts: 18
kaafe 09 Mar 2004, 18:30
Hi,

1. I am trying to add dialogs to project with fasmw. I have 3 dialogs but failed to do. For only 1 dialog no problem.

This looks,

section '.rsrc' resource data readable

directory RT_DIALOG,dialogs

resource dialogs,\
1000,LANG_ENGLISH+SUBLANG_DEFAULT,DIALOG1,\
2000,LANG_ENGLISH+SUBLANG_DEFAULT,DIALOG2,\
3000,LANG_ENGLISH+SUBLANG_DEFAULT,DIALOG3

dialog DIALOG1,'Create message box',70,70,244,144,WS_CAPTION+WS_POPUP+WS_SYSMENU+DS_MODALFRAME << THIS LINE
dialogitem 'BUTTON',"OK",IDC_BTN1,0x50010000,8,118,46,13,0x00000000
dialogitem 'BUTTON',"Cancel",IDC_BTN2,0x50010000,64,118,46,13,0x00000000
dialogitem "SysTabControl32","",IDC_TAB1,0x50018000,2,1,220,111,0x00000000
; enddialog
dialog DIALOG2,' ',4,15,216,95,WS_VISIBLE,WS_CHILD,0,WS_EX_CONTROLPARENT
dialogitem 'STATIC',"IDC_STC",IDC_STC1,0x50000000,18,20,76,9,0x00000000
dialogitem 'BUTTON',"IDC_BTN",IDC_BTN3,0x50010000,20,68,46,13,0x00000000
; enddialog
dialog DIALOG3,' ',4,15,216,95,WS_CHILD,0,WS_EX_CONTROLPARENT
dialogitem 'EDIT',"",IDC_EDT1,0x50010000,28,25,102,13,0x00000200
enddialog

but not working. For only one dialog there is no problem. The line which i pointed below is resulting an error,

Quote:
Error: Undefined symbol
instruction:
DIALOG1 dd RVA data?0000029E,size?0000029E,0,0

and points to this line in resource macro file,

macro dialog label,title,x,y,cx,cy,style,menu,exstyle,fontname,fontsize
{ local data,size,items
label dd RVA data,size,0,0 << This line is referenced
data dd style or DS_SETFONT,exstyle +0
dw items,x,y,cx,cy
[...]

2. I can not use _EX_ styles in dialogs. Neither for this example nor previous. However, i leave them in place.
Post 09 Mar 2004, 18:30
View user's profile Send private message Reply with quote
HIGH-Zen



Joined: 30 Jun 2004
Posts: 4
Location: Latvia
HIGH-Zen 30 Jun 2004, 09:42
Hi! I have expirience programming in MASM/TASM, now I try FASM, but
have similar problems, error code points somewhere in resource.inc
or in import.inc. Who can explain macros in these files, I want to try
write this without macros, to better understand this, because I see in all
examples resources and imports sections is written with macros, and when
I try write some similar code I got errors. That's the prob.
Maybe in these include files must be some comments too?
Confused

_________________
ASM ruleZ!
Post 30 Jun 2004, 09:42
View user's profile Send private message Reply with quote
Vortex



Joined: 17 Jun 2003
Posts: 318
Vortex 30 Jun 2004, 09:59
kaafe,

Fasm is able to link compiled resource (.res) files.

_________________
Code it... That's all...
Post 30 Jun 2004, 09:59
View user's profile Send private message Visit poster's website Reply with quote
HIGH-Zen



Joined: 30 Jun 2004
Posts: 4
Location: Latvia
HIGH-Zen 30 Jun 2004, 11:19
Yep, I know this, but I want to do it in source.
HOW CAN IT BE DONE? Evil or Very Mad

_________________
ASM ruleZ!
Post 30 Jun 2004, 11:19
View user's profile Send private message Reply with quote
HIGH-Zen



Joined: 30 Jun 2004
Posts: 4
Location: Latvia
HIGH-Zen 30 Jun 2004, 11:28
I wanna know, how this can be done in pure asm(FASM), how it really works,
not only write these pseudocode with macro includes.
I can't find where is described, how I must write in FASM
.rsrc and .idata sections without macros. I try to understand
these macros, but find it hard to understand, need some help...
Post 30 Jun 2004, 11:28
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8395
Location: Kraków, Poland
Tomasz Grysztar 30 Jun 2004, 11:58
Generally you need the information from this document: http://www.microsoft.com/whdc/system/platform/firmware/PECOFF.mspx (chapter 6.8 is about the resource section).

And to see how to construct the resource section with much simpler macro, please download the fasm 1.07 from the fasm archives - the old WIN32APP example in that package contains the RESOURCE.INC file that shows the first method of building resources, which is much easier to understand.
Post 30 Jun 2004, 11:58
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8395
Location: Kraków, Poland
Tomasz Grysztar 30 Jun 2004, 12:06
kaafe: you should use "enddialog" to end list of items for each dialog started with "dialog" macro.
Post 30 Jun 2004, 12:06
View user's profile Send private message Visit poster's website Reply with quote
HIGH-Zen



Joined: 30 Jun 2004
Posts: 4
Location: Latvia
HIGH-Zen 30 Jun 2004, 12:26
Thank You for quick replay!
Razz

_________________
ASM ruleZ!
Post 30 Jun 2004, 12:26
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.