LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Does Call Library Function convert LV strings to null-terminated before calling the dll?

The WINAPI dll I want to use needs a pointer to a null terminated string. Assuming I choose "string" as the type and "C string pointer" as the string format and wire in a LV constant string, does LV strip the 4 byte header, and append a null, before passing the pointer to the dll?
Message 1 of 4
(3,932 Views)
Ralph;

It should work.

Is it that you are having problems doing this, or you just want to make sure? What exactly does the dll expect? An empty string? Some information?

Regards;
Enrique
www.vartortech.com
0 Kudos
Message 2 of 4
(3,932 Views)
No problems, now. I never had used the Call Library Function before and didn't know how much trouble to expect. I just wanted to make sure. Thanks a lot.

RH
0 Kudos
Message 3 of 4
(3,932 Views)
When you specifically define an input or output as a C String or a Pascal String, LabVIEW will automatically handing null-termination or prepending the length (respectively) to the data. However, you can also just pass an array of characters [U8]'s but you will need to do the null-termination or prepending the length yourself.

Good luck, and don't be afraid to push the run button and crash LabVIEW. Just save all your work FIRST.

-Jim
Message 4 of 4
(3,932 Views)