Hello,
I am running 64-bit CCL 1.10 on Windows 7. I'm writing an interface to a National Instruments library (dll)
The library was downloaded from the NI site. It was compiled using Microsofts C++ compiler.
I get a stack dump when a pointer is being freed using foreign-free. This error occurs not in a fresh lisp
session, but after a second or third call to the same function (with same arguments).
One more detail: the library is used to access data in files in NI's TDMS format. This error does not
seem to happen on all files that I am trying to access, only some of them.
I don't have much experience in cross-language library interface building, and I am wondering if I am making
some kind of mistake. I am hoping for pointers on how to debug this further.
I define a pointer of type :uint to access results of a call to a library function that places them into an
unsigned int variable. I then retrieve the value using using mem-ref, and the free the pointer.
This is where the stack dump happens.
What follows is the defcfun, and the lisp function. I mark with *** the pointer, and the relevant variable
definitions that pertain to it:
The C-function interface (with the C-documentation included) is
(defcfun (ddc-get-num-channel-group-properties "DDC_GetNumChannelGroupProperties")
ddc-code
"
This function will get numberOfProperites (via a pointer)
int DDC_GetNumChannelGroupProperties (DDCChannelGroupHandle channelGroup,
unsigned int *numberOfProperties); *******"
(group-handle group-handle) ;; group-handle is define to be a pointer type
(num-channel-group-properties :pointer)) ;;*******