01-09-2007 02:12 PM
01-11-2007 05:56 PM
Hello James,
It looks like you might be passing the pointer to the array of buffers instead of the actual buffers that you created. Take a look at the LL Ring example: C:\Program Files\National Instruments\NI-IMAQ\Sample\MSVC\Ring\LL RingThis example is essentially a “bare bones” Ring that uses imgDisposeBuffer to dispose of an array of buffers after the image acquisition is complete.
Regards,
01-22-2007 03:56 PM
Luke
Thanks for the reply. What it turned out to be was a type difference between the way I had declared the function in my header file and the way I was calling it at runtime.
In case anyone else is interested, here are the details:
1. Function declaration:
typedef long IMAQ_STATUS;
#define IMAQ_PREFIX [DllImport("Imaq.dll")]
IMAQ_PREFIX IMAQ_STATUS imgDisposeBuffer(void* bufferPtr);
2. Invocation that returns error (and does not release memory):
imgStatus = imgDisposeBuffer (pBuffers[i]);
3. CAST, then invocation doesn't return error (and does release memory):
imgStatus = imgDisposeBuffer ((void *) pBuffers[i]);