[Gambas-user] Trouble passing struct to my clib
Brian G
brian at westwoodsvcs.com
Sat Mar 14 19:42:53 CET 2020
Well I did find an example, An I guess it's so simple.......
thanks all.
Thank You
Brian G
From: "Brian" <brian at westwoodsvcs.com>
To: "Gambas mailing list" <user at lists.gambas-basic.org>
Sent: Saturday, March 14, 2020 11:14:39 AM
Subject: [Gambas-user] Trouble passing struct to my clib
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
----[ http://gambaswiki.org/wiki/doc/netiquette ]----
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20200314/5e6e570a/attachment.html>
More information about the User
mailing list