When I see these variables being declared in a Proc, I wonder how they would be declared if they weren't in a proc.
For example,
LOCAL wc :WNDCLASSEX
LOCAL msg :MSG
LOCAL Wwd :DWORD
How can you declare a MSG structure in the .data or .data? section, or how do you declare a variable of type WNDCLASSEX?
I don't understand, thanks for any help :red
quite simply:
.DATA
wc WNDCLASSEX <>
msg MSG <>
when initializing structures, you need to use angle brackets. when you leave the brackets alone, the structure will take the default values for that structure. otherwise, you can pass in the values for each field. so for instance, if you wanted a COORD structure with X = 2 and Y = 3:
.DATA
pt COORD <2,3>
(remember, order matters)
Is the ordinal placement of array members between your > and < directly related to the way that it is written in the .inc or declared location?
thomas
Hi brixton
These structures (and many others) are defined in windows.inc ( if not wrong )
WNDCLASSEX
MSG
So, you can use it to define variables in .data or .data? section like the exmple from Jeff
or in the stack with LOCAL
Does it help ?
Rui
Thomas,
If I understand your question correctly, the answer is yes. See Structures and Unions here:
http://webster.cs.ucr.edu/Page_TechDocs/MASMDoc/ProgrammersGuide/Chap_05.htm
Many thanks for the help, yet again :U
Now I will practise using STRUCTs :green
MichaelW,
You did a great job understanding what I was asking. Phew! Thanks, that did answer my question perfectly ... and I have another help reference too! Thanks for that!!
I now understand that MASM like C, the ordinal positions of structured variables plays an important part in initializing them. I also now understand more about C.
thomas