Jump to content

Getting the data from a StringBuilder class in a DLL


Recommended Posts

Hi,

I have a DLL that returns data as a StringBuilder object. In VB, we can easily get the string value from this by calling the ToString() funtion on it.

However, I need to read this DLL from LabVIEW and can't seem to find a simple way to get the string value out of it. Has anyone done this before?

Jeffrey

Link to comment

QUOTE (altarama @ Apr 30 2009, 12:15 PM)

Hi,

I have a DLL that returns data as a StringBuilder object. In VB, we can easily get the string value from this by calling the ToString() funtion on it.

However, I need to read this DLL from LabVIEW and can't seem to find a simple way to get the string value out of it. Has anyone done this before?

Jeffrey

From what I have seen you should use an Invoke node and get the ToString() method called. I guess labview will take care of Unicode or UTF-8/32 to your code page conversion.

Link to comment

QUOTE (stevea1973 @ May 2 2009, 09:43 PM)

From what I have seen you should use an Invoke node and get the ToString() method called. I guess labview will take care of Unicode or UTF-8/32 to your code page conversion.

No LabVIEW has to this point no official Unicode support. You can make it work sort of by adding an token to the INI file but it is still not full support for Unicode strings in all LabVIEW strings.

But there is a LabVIEW VI library unicode.llb at both on the NI site and also here posted as attachment to some posts (Google is your friend :shifty: ), that calls into the MultiByteToWideChar and WideCharToMultiByte Windows APIs to do the translation between the LabVIEW MultiByte encoding and Unicode 16Bit encoding.

Rolf Kalbermatter

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.