NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Argument for function not viewed able under VC++ by teststand editer

Solved!
Go to solution

Hi All,

 

I followed all your recommondations and it is working very well.

But i got the same struggle like the upper post.

 

I am no able to create a TS string buffer field with my IDL.

if i am using BSTR it looks good but it is UniCode!

 

Here is the C-Prototype:

extern "C" DLLEXPORT INT DisplayUUTMore (SequenceContext* seqContext, short *errorOccurred, long *errorCode, char errorMsg[1024], char serialNumber[1024]);

The IDL Definition:

[entry("")] INT DisplayUUTMore ([in] IDispatch* seqContext ,[in] INT16 *errorOccurred ,[in] LONG *errorCode,[in] char errorMsg[1024],[in,string] LPSTR serialNumber);

 

Do you know how to place a char[nCnt]  as string buffer [nCnt] in the idl - language

 

 

Greetings

juergen

--Signature--
Sessions NI-Week 2017 2016
Feedback or kudos are welcome
Download All
0 Kudos
Message 21 of 25
(2,372 Views)

There is a hack you can use to get string buffers in the type library. Add the following line above your module declaration in the IDL file to declare an alias named CStr (it must be called CStr):

 

typedef [public] char **CStr;
 

Declare your function as follows:

 

[entry("")] void Function([in] CStr x);

 

I realize this is unusual and I have no good justification for it. It is just a hack that I cannot guarantee will always work in future versions of TestStand. There is no other way to get string buffer parameter types using a type library.

Message 22 of 25
(2,329 Views)

Hi Erik,

 

Yes it is working (for me) !

 

I am using the default size of 1024 bytes, but what about if like you to use a buffer of 512 bytes ?

TS always places the default size.

 

Other question about the help file. With the idl-language you can place some help information

or better you can place link to a helpfile.

Actually this working. If i press the "?" in TS my help information for this function will popup.

 

You have linked the  idl-information to the .rc -file. So it is contained in the dll itself.

Is such a feature possible with the help-file ?

If yes, can you share your knowlege with us?

 

Greetings

 

juergen

 

 

--Signature--
Sessions NI-Week 2017 2016
Feedback or kudos are welcome
0 Kudos
Message 23 of 25
(2,318 Views)

I know of no way to get the parameter string buffer size set to anything other than 1024 from the IDL.

 

I do not know if you can embed the help file in the resource file or DLL.

 

0 Kudos
Message 24 of 25
(2,295 Views)

Hi All,

 

I have found an old thread with a great answer from Scott dealing with strings in the idl - file.

Just visit it!

http://forums.ni.com/ni/board/message?board.id=330&message.id=4189&query.id=802304#M4189

 

 

juergen

--Signature--
Sessions NI-Week 2017 2016
Feedback or kudos are welcome
Message 25 of 25
(2,275 Views)