Hi, I have a simple code that calls "IMAQ Straight Edge 3" VI. The code runs fine when it is a VI. But my requirement is to build it as a DLL, later to be called from a C code. As a practice I try to call the DLL using CLFN to check if the DLL is built properly and working before writing the C code.
The following sample code contains a VI(imaqwrapper.vi) that simply wraps the IMAQ Straight Edge 3 VI(although I will add more code later). This VI is built as a DLL and called using CLFN. When the DLL function is called in caller.vi, memory error pops and LabVIEW crashes completely. (memory manager error 0x0037c03d at line 1425)
I doubt the StraightEdges array. But, since I'm passing an empty LabVIEW array handle, my expectation is that LabVIEW resizes this array as and when required without any issues.
So, I found the issue in Call Library Configuration. StraightEdges must be configured as "Adapt to type" and "Pointers to Handles"(triple pointer) instead of "Handles by value"(double pointer to array base). This fixes the error.