FIX: Compiler Errors with COleDateTime::Format (153292)



The information in this article applies to:

  • The Microsoft Foundation Classes (MFC), when used with:
    • Microsoft Visual C++, 32-bit Editions 4.0
    • Microsoft Visual C++, 32-bit Editions 4.1

This article was previously published under Q153292

SYMPTOMS

When calling the COleDateTime::Format member function with VAR_DATEVALUEONLY or VAR_TIMEVALUEONLY, you will get the following compiler error:
   error C2668: 'Format' : ambiguous call to overload function (new
                           behaviour; please see help)
					

CAUSE

The problem is caused by not defining VAR_DATEVALUEONLY and VAR_TIMEVALUEONLY as DWORD in Oleauto.h.

RESOLUTION

The workaround is to type cast these constants to DWORD.

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This problem was corrected in Visual C++ version 4.2.

Modification Type:MajorLast Reviewed:10/24/2003
Keywords:kbAutomation kbBug kbDateTime kbfix kbNoUpdate kbVC420fix KB153292