You can't return a pointer * from a library function. You must return an int%.
That int% will be the actual memory address of what you need. Then you must use RtlMoveMemory from kernel32.dll to copy the data at the memory address into a structure that Blitz can read, like a custom type or a bank. Like this:
In your decls file:
In your Blitz code:
You could also use a custom type instead of a bank.
That int% will be the actual memory address of what you need. Then you must use RtlMoveMemory from kernel32.dll to copy the data at the memory address into a structure that Blitz can read, like a custom type or a bank. Like this:
In your decls file:
; .lib "dibLib.dll" ; Functions to control binary trees ; libTree_Insert%( index$, dato* ):"_libTree_Pointer@8" ; libTree_Get%( index$ ):"_libTree_GetPointer@4" ; .lib "kernel32.dll" ; CopyMemory(Dest*, Src%, Length%):"RtlMoveMemory"
In your Blitz code:
bnk = CreateBank(length) ; This should be big enough to get the data at the memory address addr = libTree_Get("test") CopyMemory(bnk, addr, BankSize(bnk))
You could also use a custom type instead of a bank.