(This is actually in regards to http://forums.ni.com/ni/board/message?board.id=170&message.id=277290 , but I think I can phrase my problem more elegantly now.)
I have a C DLL which requires a void pointer to be passed to it. Specifically, the pointer has to point to a preallocated block of memory, into which will go a known number of 16-bit integers. The memory block then gets filled by a separate function call.
I have thus configured a Call Library Function Node to pass an array of 16-bit integers in the format of an Array Data Pointer. By specifying a minimum size, I can ensure that sufficient memory is allocated.
Unfortunately, the first two elements of the array that gets returned appear to each contain half of a 32-bit integer which I assume is a pointer to the block of memory. I'm thinking I could reconstruct the integer and then use MoveBlock (as in http://zone.ni.com/devzone/cda/epd/p/id/2242) to access the block of memory, but I can't help but think that I'm going about this entirely the wrong way - especially since LabVIEW tends to become unstable whenever I run the VI, usually crashing soon afterwards.
Does this make sense to anyone? What is the right way to do this? I suppose I could pass a single 32-bit integer (i.e. a memory address) instead of the array, but then how will I allocate the memory at that address?