LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

calling a labview dll with CVI/problems with LStrHandle

Hello,
 
I'm trying to use a labview DLL (which I can't modify since I've no access to the source) in CVI. The function I use needs 1 LStrHandle as input and 2 LStrHandle as output. But I'm getting the following error message when I'm executing the function :
"error #3: "memory.cpp", line 563, labview 6.1"
 
I've tried to allocate memory to the handle but I'm not sure at all what I'm doing (when not doing this, I receive a general protection error) :
 
  hraw = (LStr**)DSNewHandle(sizeof(LStr));
  hout = (LStr**)DSNewHandle(sizeof(LStr));
  houtp = (LStr**)DSNewHandle(sizeof(LStr));
 
 
Thanks for helping,
Arnaud
 
 
 
 
0 Kudos
Message 1 of 2
(2,562 Views)
Hi Arnaud,



I'm trying to use a labview DLL (which I can't modify since I've no access to the source) in CVI. The function I use needs 1 LStrHandle as input and 2 LStrHandle as output. But I'm getting the following error message when I'm executing the function :

"error #3: "memory.cpp", line 563, labview 6.1"

I've tried to allocate memory to the handle but I'm not sure at all what I'm doing (when not doing this, I receive a general protection error) :

hraw = (LStr**)DSNewHandle(sizeof(LStr));
  hout = (LStr**)DSNewHandle(sizeof(LStr));
  houtp = (LStr**)DSNewHandle(sizeof(LStr));



you are on the right track preallocating memory for the handles. But you will need to use certain LabVIEW functions to get the data type right, as described in the following posts: Problem using a LabView DLL in LabWindows.

The needed include files ("labview.lib", "extcode.h") can be found in the \CINTOOLS folder of a 'Full' and 'Professional' LabVIEW Package of the corresponding version.

You might also want to take a look at the referenced manual (this link points to the LabVIEW6-version of the PDF): Using External Code in LabVIEW.

Best regards,
Sebastian
0 Kudos
Message 2 of 2
(2,545 Views)