[Gambas-user] Dereferencing a pointer without Memory-Stream...

Ru Vuott vuott at ...325...
Thu Jul 19 09:49:02 CEST 2012


Hello Benoît,

...when I have an external function, which passes me a pointer to a structure, if I want to dereference the pointer in order to obtain the values ​​of various fields, which are incorporated into the structure, currently it is necessary to use the "Memory-Stream" together with "Read", and also to "Seek" if I want to read the value of a specific field of the structure.
I wonder if it can be shorter (in code writing), having a "dereferencing function" like Byte@, Int@, etc, also for the structure OR the "class specific" as: Struct@ or myClass at ...1162... So you can dereference "immediately" the pointer to the structure passed by the external function.
So you can gather the various fields into a variable-Struct or variable of my-specific-Class:

 variable_Struct_type = Struct@(pointer)

 OR

 variable_mySpecificClass_type = mySpecificClass@(pointer)

What do you think about ?

Best regards
Vuottttttttt




More information about the User mailing list