From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sanity chek fail after using DSSethandlesize in a DLL

Hi,

 

I encounter a problem unsing the function DSSet handle size in a DLL.

 

I have to make a wrapper for an API that will return strings of various size. Since I can only know the length of the string in my C wrapper I figured out that I should use the provided DSSetHandleSize func in order to resize the labview handle to hold the string i'm trying to retrieve from the API.

 

At first sight it seems to work and I retrieve a string of the right size. However, if I then try to save or touch something on the FP of my VI, labview crashes sending me this error :

" e:\builds\penguin\labview\branches\2017\dev\source\panel\fpsane.cpp(548) : DAbort 0x1A7102DF: Fatal insanities(0x00000400) exist in ReportInsanities, "

 

My C code is for now fairly simple (test purpose only) and is basicaly a simplified copy of the example given by Ni in the " Libraries and exectutable " example project.

 

c code.png

 

 

and here is the corresponding labview diagram :

 

DSSetHandle crashes LV code.png

 

the parameters of the library call are both set to string, string handle.

 

I use Labview 2017 32bits and the library is compiled using CVI 2019

 

What I found the most intriguing is that if I modify the VI given by NI in the " Libraries and exectutable " example project in order to triger the condition to pass throught that DSSetHandleSize, I have no crashes but it does not work, the string I retrieve is of the size of the string I feed in. Does the provided C example really are what's complied int the example DLL ?

0 Kudos
Message 1 of 1
(1,556 Views)