At that moment it is pointing to the string in B$, but when you use the struct in a CALLDLL the struct will be copied into non BASIC memory along with the contents of B$. Then when the call returns the copying happens in reverse. This sort of thing is pretty common in high level languages that have external function interfaces to C style APIs.
Post by Chris Iverson on Jul 15, 2021 13:10:46 GMT -5
I don't think you can in LB.
If it's a static embed, where all the contents of the struct are embedded in the parent struct(for example, the RECT structures in the COMBOBOXINFO structure), then you can just list the individual members of the sub struct in the parent struct.
Your example would look something like this:
STRUCT tagMSG, _ hwnd AS ULONG, _ message AS ULONG, _ wParam AS ULONG, _ lParam AS LONG, _ time AS ULONG, _ tPntX AS LONG, _ tPntY AS LONG
If you need to embed a pointer to a struct, you have no choice but to embed a ULONG into the spot to get the memory address, and then use RtlMoveMemory() to copy the data from the pointer into the LB struct.