Showing results for 
Search instead for 
Did you mean: 

Memory Error in Call Library Function Node calling a LabVIEW DLL

Go to solution

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( 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, 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. 

Is there anything wrong in this code? 


0 Kudos
Message 1 of 2
Accepted by topic author samkm

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.

0 Kudos
Message 2 of 2