NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Handling bstr return from DLL call

When a DLL returns a bstr value how do I set up the Return value in the module tab of the step settings? I imagine a pointer is used but I get lost at that point. How do I get the memory value into a local variable?

 

Thanks!

0 Kudos
Message 1 of 3
(3,085 Views)

Nevermind. After figuring out the correct search text I found an answer. In short, TS does not handle strings for DLL call return values.

0 Kudos
Message 2 of 3
(3,082 Views)

Also any DLL code that outputs a BSTR is likely expecting you to free it (i.e. with SysFreeString) when you are done. TestStand does not do the freeing. You will leak memory unless you do it somewhere.

 

-Doug

Message 3 of 3
(3,073 Views)