i know in fasm:


section '.data' data readable writeable
Btn:
.RECT db 50,51,52,53
.caption db 'btn test1',0
.Hint db 'this is Hint',0
......
===>
stdcall [MessageBox], 0, Btn.caption, Btn.Hint, 0 ;code is right
----------------------------------------------
section '.data' data readable writeable
Btn:
.RECT db 50,51,52,53
.caption db 'btn test1',0
.Font:
.Name db 'System',0
......
===>
stdcall [MessageBox], 0, Btn.caption, Btn.Font.Name, 0 ;code is error

why? who can help me? please!
Posted on 2002-06-28 00:43:30 by zjlcc
This is because this way you define Btn.Name label, not Btn.Font.Name. You should use structures for such inheritance, for example:


struc defRECT left,top,right,bottom
{ .left dd left
.top dd top
.right dd right
.bottom dd bottom }
struc defFONT name,size
{ .Name db name,0
.Size dd size }

Btn:
.RECT defRECT 50,51,52,53
.caption db 'btn test1',0
.Font defFONT 'System',12

;........

stdcall [MessageBox], 0, Btn.caption, Btn.Font.Name, 0
Posted on 2002-06-28 04:29:50 by Tomasz Grysztar
:alright:
Posted on 2002-06-29 23:50:36 by zjlcc