01-11-2007 08:13 AM
01-12-2007 01:24 PM
01-22-2007 03:58 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]);