LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error Code 1097 Coming in DLL Calling

Solved!
Go to solution

Hi nathand,

 

I got the same situation here, from my dll configuration what I gain is my return type is CString as  pointer to an array characters.

 

nathand wrote

"If CString is defined as a pointer to an array of characters, you can pass the data to it from LabVIEW, but you need to call LabVIEW memory manager functions to allocate memory for the string and copy data into it."

 

Upon this I have few questions,

 

Can you please elaborate how to implement this solution, specially how to choose Memory manager function and do i need to wrtie C program for it ?

 

From here how to choose function and implement them ?

 

Thanks for help.

 

 

 



 

-
Amit
CLAD
Download All
0 Kudos
Message 21 of 25
(1,605 Views)

CString is a MFC datatype. It is a C++ object type that represents a string but is pretty different from a simple C string pointer.

 

There is no way to access the actual elements of a CString from within LabVIEW since the C++ object interface is pretty compiler specific and creating a configuration interface like the Call Library Node configuration dialog for it would be catastrophically complicated to use, where the current dialog looks like peanuts in comparison.

 

So writing a wrapper DLL in C++ is definitely unavoidable.

 

Rolf Kalbermatter
My Blog
Message 22 of 25
(1,595 Views)

The link you posted is spitting a 404 error for me. Is this an equivalent source, eh?

https://forums.ni.com/t5/Developer-Center-Resources/Tutorial-Creating-Wrapper-VIs-for-C-C-DLL-functi...

0 Kudos
Message 23 of 25
(1,461 Views)

Not sure which link in the thread you're referring to, but in any case it's probably not the same tutorial. There is discussion in this thread of creating a new DLL using C constructs only, that wraps a C++ DLL. The link you posted explains how to create a library of LabVIEW VIs that wrap the functions in a DLL. However, if the DLL you are trying to call uses C++ data types, you first need to create a C wrapper DLL as discussed here, then use the import wizard described in your link.

Message 24 of 25
(1,457 Views)

Gotcha, I'll give that a shot.

I'd meant to direct my comment to Carmen_Martinez from the first page but caught it too late to edit the post.

Thank you for the help y'all left here.

0 Kudos
Message 25 of 25
(1,448 Views)