RE: DLL return value
Like you use Interop.Call with Windows API's, you need to allocate some memory space in your script first (Interop.Allocate).
Then, in the script, you call the function in the DLL and you provide the pointer to that allocated space as a parameter. In your DLL you write whatever stuff you want to that pointer.
And make sure you don't exceed the available space! This can be done by providing a size parameter in the script when you call the function. Or write the size in the first x bytes (as much as you need, eg: 4 bytes, thus as a DWORD) of the allocated space. Both methods also used in many Windows APIs.
The data you write to that pointer can be whatever you want. It is how you handle and interpret that data in the script what makes sense of it.
This post was edited on 12-29-2006 at 10:01 AM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
|