Hi,
I'm trying to get an API call FindFirstFileA() working. This API-function needs a structure. Not to pass information to the API-function but the API-function fills this structure, in this case WIN32_FIND_DATA, with file information, which you can use. The members of this structure have information about the First File Found. I build this structure with the 'declarestruct' command and pass this as a parameter. This parameter is the pointer to the structure.
This structure has nested structures and I declared them as follows:
declarestruct mystruct E1,E2,E3,(E4a,E4b),(E5a,E5b),E6, etc.
Can someone confirm the syntax I used here? At least the program doesn't complain about this construction at compile time, I think this is positive ;-)
The FindFirstFileA() function returns a HANDLE to a FileFind object and the only variable type that doesn't complain is the "A" type. All other types deliver a variable type mismatch message. Where does this A-type variable stand for? Is that: one of all the other known Alphas var-types or can this also be a type unknown the Alpha types. This handle is passed to the FindNextFile() API-function. But that's for the future.
I discovered that I could write:
declarestruct flname C255text
declarestruct WIN32_FIND_DATA L1dwFileAttrib,(L1ftCreationTimeLow, L1ftCreationTimeHigh), etc. its very long.
declare FindFirstFileA L(flname)(WIN32_FIND_DATA)
dim result as A
dim fn as P 'pointer
dim fd as P 'pointer
fn.filename = c:\*.txt
result = FindFirstFileA(fn,fd)
findclose(result)
I can't get access to the members of fd.dwFileAttrib, fd.ftCreationTimeLow etc. Actually I need the pointer address of WIN32_FIND_DATA. I see that you can pass information to the function, get something returned from the function such as "result" but if you pass a structure in the hope the calling function fills it, it doesn't work. Or at least it works but I can't access it. I know that it is a very delicate chain of things that you have to do in the right way. At this moment I'm trying to get clear what I'm doing is right/wrong and even it maybe just impossible in A5v5. The manual(s) and the examples I found on sites show only straightforward examples, I didn't see constructions like I need. Maybe someone has an example for these constructions.
Thanks for your time reading this,
Marcel
I'm trying to get an API call FindFirstFileA() working. This API-function needs a structure. Not to pass information to the API-function but the API-function fills this structure, in this case WIN32_FIND_DATA, with file information, which you can use. The members of this structure have information about the First File Found. I build this structure with the 'declarestruct' command and pass this as a parameter. This parameter is the pointer to the structure.
This structure has nested structures and I declared them as follows:
declarestruct mystruct E1,E2,E3,(E4a,E4b),(E5a,E5b),E6, etc.
Can someone confirm the syntax I used here? At least the program doesn't complain about this construction at compile time, I think this is positive ;-)
The FindFirstFileA() function returns a HANDLE to a FileFind object and the only variable type that doesn't complain is the "A" type. All other types deliver a variable type mismatch message. Where does this A-type variable stand for? Is that: one of all the other known Alphas var-types or can this also be a type unknown the Alpha types. This handle is passed to the FindNextFile() API-function. But that's for the future.
I discovered that I could write:
declarestruct flname C255text
declarestruct WIN32_FIND_DATA L1dwFileAttrib,(L1ftCreationTimeLow, L1ftCreationTimeHigh), etc. its very long.
declare FindFirstFileA L(flname)(WIN32_FIND_DATA)
dim result as A
dim fn as P 'pointer
dim fd as P 'pointer
fn.filename = c:\*.txt
result = FindFirstFileA(fn,fd)
findclose(result)
I can't get access to the members of fd.dwFileAttrib, fd.ftCreationTimeLow etc. Actually I need the pointer address of WIN32_FIND_DATA. I see that you can pass information to the function, get something returned from the function such as "result" but if you pass a structure in the hope the calling function fills it, it doesn't work. Or at least it works but I can't access it. I know that it is a very delicate chain of things that you have to do in the right way. At this moment I'm trying to get clear what I'm doing is right/wrong and even it maybe just impossible in A5v5. The manual(s) and the examples I found on sites show only straightforward examples, I didn't see constructions like I need. Maybe someone has an example for these constructions.
Thanks for your time reading this,
Marcel
Comment