Using a C library

Just starting out? Need help? Post your questions and find answers here.
User avatar
tinman
PureBasic Expert
PureBasic Expert
Posts: 1102
Joined: Sat Apr 26, 2003 4:56 pm
Location: Level 5 of Robot Hell
Contact:

Post by tinman »

Lazarus404 wrote:Tsk* I can't do it. The language I wish to consume the dll, although capable of handling pointers, can only do so by wrapping the pointer in a struct before handling it. This means I can't wrap it in PB, because PB doesn't like to handle the structs themselves but will the pointer. It's like the chicken and egg issue. :(
What language are you trying to get it into? There must be some mechanism to get it into there, because you either return values through registers (e.g. a single value or pointer to struct) or through memory (fill in the struct in memory). That's the underlying techniques no matter what syntax the language uses.

It might be more awkward if it's returned on the stack, but not impossible.
If you paint your butt blue and glue the hole shut you just themed your ass but lost the functionality.
(WinXPhSP3 PB5.20b14)
Post Reply