[REBOL] Intrefacing dll library in pascal format
From: th72::dds::nl at: 19-Dec-2006 17:27
Hello list,
I am trying to interface the dallas TMex (ibutton) library to rebol.
I'ts programmed (the library) in pascal so I don't know if it is
possible to interface it with rebol. Sofar it is possible to open a
session and do the first setup. After that.....?
The problem is with:
*short far pascal TMFirst(*
*long* /session_handle/*, * // session handle for the desired 1-Wire
network
*void far **/state_buffer/ // state buffer provided for the 1-Wire
network session
*);
*and:
*short far pascal TMRom(*
*long* /session_handle/*, * // session handle for the desired 1-Wire
network
*void far **/state_buffer,/ // state buffer provided for the 1-Wire
network session
*short far **/ROM/ // buffer to read or write from the internal
ROM buffer
*);
*What do I do with the *state_buffer?
The doc says:
/state_buffer/
Specifies a pointer to a memory location that TMEX keeps all of the
state information for the 1-Wire networks. This parameter is required by
most TMEX API functions.
I tried in Rebol something like this:
tmfirst: make routine! [
session [integer!]
buffer [string!]
return: [integer!]] tmex-lib "TMFirst"
I tried it even with a struct! but also no luck.
How do I define "buffer" and how do I pass the buffer-pointer to TMrom?
Rebol crashes or the buffer stay's empty.
Has someone tried this before or is this something way above my head???
Thanks for your time!
Tim