FIX: MCIWndGetPositionString Makes Time Format Milliseconds
Article ID: 135304
Article Last Modified on 11/1/2006
APPLIES TO
- Microsoft Video for Windows Development Kit 1.1
- Microsoft Platform Software Development Kit-January 2000 Edition, when used with:
- Microsoft Windows 3.1 Standard Edition
- Microsoft Windows 3.11 Standard Edition
- Microsoft Windows NT Server 3.5
- Microsoft Windows NT Server 3.51
- Microsoft Windows NT Server 4.0 Standard Edition
- Microsoft Windows NT Workstation 3.5
- Microsoft Windows NT Workstation 3.51
- Microsoft Windows NT Workstation 4.0 Developer Edition
This article was previously published under Q135304
SYMPTOMS
Calling MCIWndGetPositionString causes the time format (set with
MCIWndSetTimeFormat) to change to milliseconds. This applies only to
devices that have tracks.
RESOLUTION
To work around the problem, reset the time format after calling
MCIWndGetPositionString as follows:
#ifdef _WIN32
TCHAR pszFormat[30]; // Use a TCHAR in Win32
TCHAR pszPosition[30];
#else // Not Win32
char pszFormat[30];
char pszPosition[30];
#endif
// Get the time format - hWnd is the hWnd of the MCIWnd
MCIWndGetTimeFormat(hWnd, pszFormat, sizeof(pszFormat));
// Get the position - hWnd is the hWnd of the MCIWnd
MCIWndGetPositionString(hWnd, pszPosition, sizeof(pszPosition));
// Reset the time format - hWnd is the hWnd of the MCIWnd
if (0 == MCIWndSetTimeFormat(hWnd, pszFormat))
// Successful
else
// Could not reset time format
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 Microsoft Windows 2000.
Keywords: kbbug kbfix kboswin2000fix KB135304