08-27-2006 11:43 PM
09-13-2006 04:29 AM
09-13-2006 05:11 AM
Hi,
Can you show a jpg of the specify dialog or post the sequencefile?
Regards
Ray Farmer
09-13-2006 09:57 AM
That is one of the few prototypes that TestStand doesn't support because TestStand limits return values to numerics and boolean data types.
However, you can easily work around this by creating a wrapper function around your existing function that instead returns the string via a parameter.
Your next issue is what is the caller expected to do with the string pointer. If returned pointer is to a buffer the caller does not free, then there is no problem.
If the caller is expected to free the buffer, TestStand can't do that because it doesn't know what memory manager to use to free it. In that case, your wrapper function would copy the string into the string parameter and then free it. In the TestStand call to the wrapper, you would have to specific an adequate string size to receive the copy.
Note that in your sample function, you return in internal pointer to data in the CString object which will be destructed when the function exits, thus freeing the memory that contains the string. This is incorrect. You could make the CString a static variable to avoid the problem if you are ok with it holding onto the string data between calls and if you know you won't call the function from multiple threads at the same time.