[Gambas-user] Trouble passing struct to my clib

Brian G brian at westwoodsvcs.com
Sat Mar 14 19:14:39 CET 2020


I am trying to pass a structure to my clib 

Reading the documentation, struct is like a global class but an embedded struct is like an unpacked c struct access via a virtual object. 

You can create embedded structure arrays where the data is created directly in the array, statically 

My understanding then is as follows 

struct xx 
a as integer 
end struct 

dim y[1] as xx should create an array where the structure is embedded already allocated. Correct? 

but y[0].a = 1 yields an error I must do y[0] = new xx ... ummm maybe I don't understand embedded correctly 
as the doc says that Gambas creates a virtual object to work with the data. 

Then I am having a problem understanding how to actually pass the address of y[0] or y for that matter to my c function 

I would love if someone could point me in the correct direction. Please 


Thank You 
Brian G 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20200314/a69f7efd/attachment.html>


More information about the User mailing list