05-30-2024, 09:55 PM
I'm pretty sure in this context the `ByRef pData As Any` is just their way of expressing the `void *` type in C. That itself more or less just means it's a pointer to data but the type of data is not specified. As far as QB64 is concerned, you'd just replace it with a ByVal _OFFSET.
KernelPanic explained the Union thing, I'd say in practice what you'll need to do in QB64 is use a memory buffer and copy the data into variables of the right kind based on the dwType entry, so a fair amount more annoying (since QB64 doesn't have actual unions to use). I'd probably just use `_MEMNEW()` to create a memory block of the right size and pass that in as `pData`. Then you can use `_MEMGET` to copy the union section into separate variables of the proper TYPE after checking the `dwType` value, and go from there.
KernelPanic explained the Union thing, I'd say in practice what you'll need to do in QB64 is use a memory buffer and copy the data into variables of the right kind based on the dwType entry, so a fair amount more annoying (since QB64 doesn't have actual unions to use). I'd probably just use `_MEMNEW()` to create a memory block of the right size and pass that in as `pData`. Then you can use `_MEMGET` to copy the union section into separate variables of the proper TYPE after checking the `dwType` value, and go from there.