Hi
From the tutorial
==============
.DATA
ClassName db "SimpleWinClass",0
AppName db "Our First Window",0
.DATA?
hInstance HINSTANCE ?
CommandLine LPSTR ?
=================
Must everything written in .DATA end with a '0'
Must everything wititten in .DATA? end with a '?'
I think the information in .DATA? refers to WinMain proto. In the programmers guide is says that 'hInstance' Identifies the current instance of the application and that 'lpszCmdLine' Points to a null-terminated string specifying the command line for the application.
My question is- Why does the tutorial call it 'CommandLine' and the guide call it 'lpszCmdLine'?
Thanks
Steve
From the tutorial
==============
.DATA
ClassName db "SimpleWinClass",0
AppName db "Our First Window",0
.DATA?
hInstance HINSTANCE ?
CommandLine LPSTR ?
=================
Must everything written in .DATA end with a '0'
Must everything wititten in .DATA? end with a '?'
I think the information in .DATA? refers to WinMain proto. In the programmers guide is says that 'hInstance' Identifies the current instance of the application and that 'lpszCmdLine' Points to a null-terminated string specifying the command line for the application.
My question is- Why does the tutorial call it 'CommandLine' and the guide call it 'lpszCmdLine'?
Thanks
Steve
The data structures in the .DATA section are null terminated strings, a C convention for strings manipulation. So the end up with a zero as a marker for the end of the string.
The answer to your Question si NO. Thisnh in .DAT section do nOT have to end up in 0. However they might.
The things in .DATA section do not have to end in ?
"?" is a notation to tell the assembler that you do not care for the value there. Any other value there will be a problem since the .DATA? section is not initialized.
So again the answer to you question is NO the things in .DATA? do NOT have to end up in ? . They must use "?" instead of numerical values or elese it will be an error at compile time.
For the other question:
People use to call things in many ways, never assume that it will be a single naming convention for the same thing ;) You have to be smart enough to figure out wich is what.
lpszCmdLine is the so called Hungarian notation that is pretty commom with programmers;
what it said:
lp = long pointer aka a 32bits pointer
sz = nul terminated string "S"tring "Z"ero
CmdLine = a abbreviation of "Command Line"
So it is "a pointer" to "a null terminated string" that represents the "Command Line" that the application receivers when it starts up from the Operating system ;)
Nope, variables defined in the .DATA and .DATA? section are global by their nature and thus they do not refer to a certain PROTO... Where they are used..is another issue.
LOCAL variables that exist only during a PROCedure execution are define in the PROCedure's definition and they are indeed specific to a certain procedure only.
The answer to your Question si NO. Thisnh in .DAT section do nOT have to end up in 0. However they might.
The things in .DATA section do not have to end in ?
"?" is a notation to tell the assembler that you do not care for the value there. Any other value there will be a problem since the .DATA? section is not initialized.
So again the answer to you question is NO the things in .DATA? do NOT have to end up in ? . They must use "?" instead of numerical values or elese it will be an error at compile time.
For the other question:
People use to call things in many ways, never assume that it will be a single naming convention for the same thing ;) You have to be smart enough to figure out wich is what.
lpszCmdLine is the so called Hungarian notation that is pretty commom with programmers;
what it said:
lp = long pointer aka a 32bits pointer
sz = nul terminated string "S"tring "Z"ero
CmdLine = a abbreviation of "Command Line"
So it is "a pointer" to "a null terminated string" that represents the "Command Line" that the application receivers when it starts up from the Operating system ;)
Nope, variables defined in the .DATA and .DATA? section are global by their nature and thus they do not refer to a certain PROTO... Where they are used..is another issue.
LOCAL variables that exist only during a PROCedure execution are define in the PROCedure's definition and they are indeed specific to a certain procedure only.
Thanks for your help. I appreciate it.
Steve
Steve