Hello,
i have a problem with the ADDR Function
why is there a Syntax error because of ADDR fontClass?
[..]
.data
fontClass db "Tahoma", 0
[..]
Dialog "Dialog With Icon", ADDR fontClass, 9, \ ; caption,font,pointsize
WS_OVERLAPPED or WS_SYSMENU or DS_CENTER, \ ; style
3, \ ; control count
50,50,150,80, \ ; x y co-ordinates
1024 ; memory buffer size
if i writte "Tahoma" instead of ADDR fontClass everything works
Ussually ADDR is used to obtain the address of a symbol when that symbol's address is unknown at compile time but will be known at runtime. Such an example is a local variable inside a PROC and in this case the ADDR will generate a hidden LEA instruction in order to obtain that address at runtime.
However when the variable is defined in the data section and thus known at compile time it is a custom to use OFFSET instead of ADDR.
Hence my first suggestion would be to try with OFFSET.
Then I guess that "Dialog" is a macro and this might (or might not) complicate things a little. This depends on the macro definition and it's parameters handling.
Hello,
when i use offset this error appears:
"initializer magnitude too large for specified size"
i have no idea :-(
The Dialog macro is coded to take a quoted string, a string address will not work. The definition is in \masm32\include\dialogs.inc.
thx
i have another question
when i use CallModelessDialog instead of CallModalDialog no Dialog Window appears.
why?