Millisecond resolution in date/time COM property
I have a COM Automation object based on the MFC CCmdTarget class and one of its properties is a date/time stamp. Internally, the application acquires date and time via the SYSTEMTIME structure and a call to ::GetSystemlTime(). The SYSTEMTIME structure has a field for milliseconds and calls to ::GetSystemTime() always fill in this field.
However, the standard method of accessing a date/time (at least 10 years ago when this server was created) is via the VARIANT VT_DATE type which I understand is equivalent to the DATE type and apparently the DATE / VT_DATE type does not have millisecond resolution. So, whenever a COM client accesses the date and time from my server, the milliseconds field is truncated to 0. This has been acceptable until recently when it was determined that a particular client application would benefit greatly from having millisecond resolution.
This client application is written in C# and it is able to access my property via the C# object DateTime, The DateTime object has millisecond resolution but, again, when it accesses my property the milliseconds are truncated.
My question is this: Is there some way I can modify my old MFC CmdTarget-based object to return a date/time with millisecond resolution? I don't really want to use a work-around, such as creating a new property or method that returns something like a string formatted to include milliseconds.
Re: Millisecond resolution in date/time COM property