Hi,
I have several questions concerning API programming. These questions are the result of studing the Pie Chart of Peter Wayne but are also common Alpha questions to me after not finding a clear answer in the manual.
1. I have a win32.hlp help file and all the functions are listed without an "A" at the end of the function name, e.g. SetFileAttributes gives an error but SetFileAttributesA will execute without an error. Why do I have to put an A at the end of the function name and is this always the case and is this Alpha Five specific?
2. The syntax and the construction of "declarestruct" and "declare" are not as clear to me as is should be :-), I read the manual for this subject several times and studied examples but I think my syntax recognition has a flaw. I do know the difference between the two but the parameter are not as obvious to me as I thought. Are there maybe BNF notations of these syntaxconstructions?
e.g. In the following construction of a structure:
declarestruct text C1024text
I know now that this says it is a structure with the name "text"(the first text) and it has one member "text" which is a buffer of 1024 characters (C1024text).
When I create a dot variabele "temp.text" at wich part of the declare construction do I reference; the "text" or the "C1024text".
3. The manual says that structures can be nested. I've looked for an example but found none at this moment. Does anyone has an example? All the examples I tries showes to me the most beautiful errors ;-)
4. Declare. Which one is correct, the first or the second?
declare user32 GetWindowText@GetWindowTextA LL(text)L
declare user32 GetWindowText@GetWindowText LL(text) as L
I found the first in the 'old' manual and the second in the last XBasic Reference manual with Date: June 5, 2003. In this manual is also listed:
------------manual text begin ---------
[We declare GetWindowText to return a long, take a long 'window' handle as the first argument and a 1024 character buffer as the second argument and a long length as the third argument.]
declarestruct text C1024text
declare user32 GetWindowText@GetWindowText LL(text) as L
------------ manual text end ----------
I think the text between [..] is wrong. Another question is why should I declare GetWindowText@GetWindowText before and after the @ the same? Is the A ommitted after the second GetWindowText?
I hope someone can give me the right answers, the differences and the right text and some hints.
Thanks in advance,
Marcel
I have several questions concerning API programming. These questions are the result of studing the Pie Chart of Peter Wayne but are also common Alpha questions to me after not finding a clear answer in the manual.
1. I have a win32.hlp help file and all the functions are listed without an "A" at the end of the function name, e.g. SetFileAttributes gives an error but SetFileAttributesA will execute without an error. Why do I have to put an A at the end of the function name and is this always the case and is this Alpha Five specific?
2. The syntax and the construction of "declarestruct" and "declare" are not as clear to me as is should be :-), I read the manual for this subject several times and studied examples but I think my syntax recognition has a flaw. I do know the difference between the two but the parameter are not as obvious to me as I thought. Are there maybe BNF notations of these syntaxconstructions?
e.g. In the following construction of a structure:
declarestruct text C1024text
I know now that this says it is a structure with the name "text"(the first text) and it has one member "text" which is a buffer of 1024 characters (C1024text).
When I create a dot variabele "temp.text" at wich part of the declare construction do I reference; the "text" or the "C1024text".
3. The manual says that structures can be nested. I've looked for an example but found none at this moment. Does anyone has an example? All the examples I tries showes to me the most beautiful errors ;-)
4. Declare. Which one is correct, the first or the second?
declare user32 GetWindowText@GetWindowTextA LL(text)L
declare user32 GetWindowText@GetWindowText LL(text) as L
I found the first in the 'old' manual and the second in the last XBasic Reference manual with Date: June 5, 2003. In this manual is also listed:
------------manual text begin ---------
[We declare GetWindowText to return a long, take a long 'window' handle as the first argument and a 1024 character buffer as the second argument and a long length as the third argument.]
declarestruct text C1024text
declare user32 GetWindowText@GetWindowText LL(text) as L
------------ manual text end ----------
I think the text between [..] is wrong. Another question is why should I declare GetWindowText@GetWindowText before and after the @ the same? Is the A ommitted after the second GetWindowText?
I hope someone can give me the right answers, the differences and the right text and some hints.
Thanks in advance,
Marcel
Comment