07-03-2009 03:45 AM
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
07-07-2009 10:21 AM
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.
07-08-2009 01:04 AM
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
07-09-2009 08:34 AM
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.
07-13-2009 03:14 PM
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