NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Modifying a string in a DLL

I am using the flexible DLL prototype adapter to pass a test stand string (local). I wish to modify the contents of the string within the body of my DLL 'C' Function.

When I try to use a type that will allow the code to make the modifications on the test stand variable, Test Stand generates an error when it checks my type library.

I have tried using the following string types in my code:
LPCTSTR* pszString
BSTR* pbstrString

Both types generate a type not supported message in Test Stand.

Is it possible to perform this action using test stand?
0 Kudos
Message 1 of 3
(3,392 Views)
You may already know about this, but in case you don't...

TestStand defines certain custom attributes you can tag your parameters with in your IDL file, to give TS more info about how to handle them than a type-library normally provides. Reference this KnowledgeBase article:

Title: How Do I Create a Type Library Using Visual C++?
KnowledgeBase ID: 1P68ATSR

In the end, you want to get TestStand to choose "C String Buffer" as the type of the parameter. "C String Buffer" can be modified from the DLL, "C String" cannot.

- Ron
0 Kudos
Message 2 of 3
(3,392 Views)
Hi C_Test,

A character string (char[]) can be modified inside a DLL call. Just as Ron said, to TestStand this is C String Buffer which is modifiable from the C DLL.

Attached is a zipfile containing a sequence file (teststring.seq) which calls a Visual C++ 6 DLL that contains one function takes one input parameter (char mystring[1024]). The input string is modified, and the sequence file displays before and after message popups to show that this works.

Regards,
David Mc.
National Instruments - Applications Engineeing
0 Kudos
Message 3 of 3
(3,392 Views)