LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Handling wide char format string returned val from a win std dll

I have a standard windows dll that returns a string in wide character format.  I am using the Call Library Function Node but only get the first character of the returned string because of the embedded nulls.  How do I get LV to handle this?
0 Kudos
Message 1 of 6
(3,695 Views)
Hi jtc,

I looked into this a little bit, and I recommend that you check out this previous knowledgebase article on Using Call Libary Function Nodes with Unicode inputs

and this previous forum thread that talks about converting unicode to ASCII

Specifically, take a look at the library that rolfk posts.

Hope that helps!

Kind regards,
-Sam F, DAQ Marketing Manager
0 Kudos
Message 2 of 6
(3,680 Views)
    Thanks SamboNI, but I think I'm missing something...my problem is not with calling the DLL, but with receiving a string from the DLL.  It looks like all the stuff you pointed me too is for passing a string when calling a DLL's function.  Am I misunderstanding something?

Jim
0 Kudos
Message 3 of 6
(3,670 Views)
Hi jtc,

I was referring to one of the files in the llb that rolfk posted, called convert UTF16 pointer to ASCII (reattached). Assuming this functions properly, it should enable you to convert wide char format (Unicode) to ASCII.

Regards,
-Sam F, DAQ Marketing Manager
0 Kudos
Message 4 of 6
(3,663 Views)
Thanks SamboNI.
I  must admit, I can't stand LV!  I don't use it much and am quite glad of it.
I spent about 30 minutes (WAY TOO LONG!) trying to figure out how to use the vi you sent me within another vi's diagram...NO LUCK!
Then I thought I would just use the vi itself and "tap in" to test it...NO LUCK!  I put the Call Library Function Node on the diagram and configure it to use the DLL; I am assuming I connect the output of the node to the Unicode Pointer In of the vi...won't work...different data types.
This is getting absolutely ridiculous.  Why is a programming environment designed for non-programmers so darn hard to use?  AND I"M A PROGRAMMER!
All I want to do is call a function in a standard Windows DLL that RETURNS a wide character format string from withing a vi.
Is there anything else you can tell me that can keep this original 10 minute task, that has already consumed 3 hours, from taking 3 more hours of my life?

Message Edited by jtc@mds on 02-06-2007 01:33 PM

Message Edited by jtc@mds on 02-06-2007 01:34 PM

0 Kudos
Message 5 of 6
(3,658 Views)
SamboNI,

Just on a lark - I had 10 minutes to spare - I tried the same thing except I configured the Node to think the return value was a numeric 32 Unsigned instead of a string...it seems like it works!

Thanks for now, hopefully this initial success is not erroneous.

Jim
0 Kudos
Message 6 of 6
(3,647 Views)