LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Array into dll

I built a dll in LV 7. One of the inputs was an array of strings. LV created the following typedef for this input:
typedef struct {
long dimSize;
LStrHandle elt[1];
} TD2;
typedef TD2 **TD2Hdl;

The function prototype generated by LV is:
void __stdcall AddRow(TD1 *errorInNoError, TD2Hdl *TestResult,
LVRefNum *WordTableIn, LVRefNum *WordSelectionIn, TD1 *errorOut);

The question is to call this function, what do I have to pass into the dll from LV? I've tried several ways and it keeps crashing. When I create the dll, it doesn't give me the option to define the input as an array, it just creates the typedef. So when I configured the dll, I chose "Adapt to Type". This didn't work with either "Handle by Value" or "Pointer to Handle". If
I configure the input as an Array, there is no string type listed (uint32 maybe?)

TIA
Bill F
0 Kudos
Message 1 of 3
(3,079 Views)
Did you set the Calling Convention as "stdcall" in the Call Library Function node of LabVIEW? The default is C.
0 Kudos
Message 2 of 3
(3,079 Views)
Hello Bill,

As an example of this type of program, you might want to check out some of the following links:

Creating and Calling LabVIEW DLLs with Various Data Types from Microsoft Visual Basic

Creating and Calling LabVIEW DLLs with Various Data Types from CVI

Creating and Calling LabVIEW DLLs with Various Data Types from Microsoft Visual C++

We also have a few example programs that we are working on that are not yet on our
website. These are example of how to configure a LabVIEW DLL passing string arrays. I attached the ZIP file to this post.

I hope this helps!

Liz F
National Instruments
Download All
0 Kudos
Message 3 of 3
(3,079 Views)