01-22-2008 05:48 PM
01-23-2008 08:34 PM
02-01-2008 11:41 AM
I tried Jessica's suggestion - assigning DATE to a number and use Str() to convert to a string. I got a string with the format of double, eg 12345.678. In my application, I can't do the convert in TS sequence. It needs to be in the C code. Could you give me any suggestion?
Thanks
Eric
02-04-2008 05:16 PM
02-05-2008 07:01 PM
Jessica,
I have a custom user interface using TS engine. When I get TS_UIMsg_OutputMessages message from TS, I need to log all OutputMessage from OutputMessages to a text file. I got date variable from TS_OutputMessageGetTimeStamp, but I'm not sure how to convert to a date string.
Here is what I've done :
case TS_UIMsg_OutputMessages:
{
...
Date date;
TS_EngineGetOutputMessages(gEngine, 0, &hSrcMessages);
TS_EngineNewOutputMessages(gEngine, 0, &hDestMessages);
TS_OutputMessagesTransferMessagesToCollection(hSrcMessages, 0, hDestMessages);
TS_OutputMessagesGetCount(hDestMessages, 0, &count);
if ( count <= 0 )
{
CA_DiscardObjHandle(hDestMessages);
CA_DiscardObjHandle(hDestMessages);
break;
}
for(i=0; i<count; i++)
{
TS_OutputMessagesGetItem(hDestMessages, 0, CA_VariantLong(i), &hMessage);
TS_OutputMessageGetTimeStamp(hMessage, 0, &date);
// log message here with timestamp
}
...
}
02-05-2008 07:01 PM
Jessica,
I have a custom user interface using TS engine. When I get TS_UIMsg_OutputMessages message from TS, I need to log all OutputMessage from OutputMessages to a text file. I got date variable from TS_OutputMessageGetTimeStamp, but I'm not sure how to convert to a date string.
Here is what I've done :
case TS_UIMsg_OutputMessages:
{
...
Date date;
TS_EngineGetOutputMessages(gEngine, 0, &hSrcMessages);
TS_EngineNewOutputMessages(gEngine, 0, &hDestMessages);
TS_OutputMessagesTransferMessagesToCollection(hSrcMessages, 0, hDestMessages);
TS_OutputMessagesGetCount(hDestMessages, 0, &count);
if ( count <= 0 )
{
CA_DiscardObjHandle(hDestMessages);
CA_DiscardObjHandle(hDestMessages);
break;
}
for(i=0; i<count; i++)
{
TS_OutputMessagesGetItem(hDestMessages, 0, CA_VariantLong(i), &hMessage);
TS_OutputMessageGetTimeStamp(hMessage, 0, &date);
// log message here with timestamp
}
...
}
02-05-2008 07:57 PM
could you convert it to a variant and then do something with it... i.e. CA_VariantDate function converts the Date to a variant and then maybe use some of the variant functions to get it as a string???
I don't have CVI or I'd play around with it. Sorry!
OR what about the asctime function? I'm assuming the Date datatype is just a struct like that.
Anyhow, that's my 2 cents.
02-06-2008 10:04 AM
From MSDN: some C Windows SDK functions that could help you are:
VariantTimeToSystemTime
GetDateFormat or GetDateFormatEx
02-07-2008 09:57 AM
James,
Thanks. It works.
Eric