View Single Post
Old 07 March 2008, 18:56   #4
eLowar
Citizen of Elthesh
 
eLowar's Avatar
 
Join Date: Sep 2003
Location: UK
Posts: 949
The library itself is plain C and only uses plain C datatypes. My Pascal is a little shaky (haven't used it in years and years), so I'm not sure how to properly translate the prototype.

What I can tell you is that the Device pointer (Pascal has pointers and/or references too, right?) you get is just a handle, probably 32 bits (depending on what architecture the DLL was compiled for, but 32 bits are likely), and you only have to store it and pass it to the appropriate functions. The contents of the pointer are completely irrelevant to you and only matter to the library, so I assume any datatype with the right size will do (maybe a 32-bit integer type).

As for the name parameter, that's a plain C string (address of a character array), which may be tricky because Pascal (as far as I remember) stores strings differently than C. While C stores them \0 (null character) terminated, Pascal (again, as far as I remember) prefixes them with their length instead. I'm sure if you look up general information about accessing C libraries from Pascal that problem will be addressed, though.

Edit: I reformulated some things after thinking after writing.

Last edited by eLowar; 07 March 2008 at 19:08. Reason: Clarified some things.
eLowar is offline  
 
Page generated in 0.10717 seconds with 11 queries