Article ID: 297463
This article was previously published under Q297463
When you use the VariantTimeToSystemTime function to convert variant time to system time and the SystemTimeToVariantTime function to convert system time to variant time, the milliseconds value appears as zero or is ignored.
SystemTimeToVariantTime (which uses the VarUdateFromDate function) and VariantTimeToSystemTime (which uses the VarDateFromUdate function) are not resolute up to milliseconds.
Do not use SystemTimeToVariantTime, VariantTimeToSystemTime, VarUdateFromDate, or VarDateFromUdate if you require millisecond resolution.
Beginning with Microsoft Windows NT 4.0 Service Pack 4 (SP4), Windows 95 with Distributed Component Object Model (DCOM) 1.2, and Windows 98, Automation now supports passing user-defined types (UDTs) in variants and safearrays of user-defined types as arguments to methods. This allows methods to return UDTs and allows programmers of Automation controllers (Automation clients) to call methods that require pointers to structures. As an alternative to using the above-mentioned functions, you can wrap the SYSTEMTIME structure to a user and pass the user-defined data type to automation interfaces.
To reproduce this problem, replace the code that is generated for a standard console application with the following code:
Article ID: 297463 - Last Review: October 26, 2012 - Revision: 2.0
Contact us for more help
Connect with Answer Desk for expert help.