The IDirectMusicSegment::GetLength method retrieves the length of the segment.
HRESULT GetLength(
  MUSIC_TIME* pmtLength
);
 If the method succeeds, the return value is S_OK.
If it fails, the method may return E_POINTER.
If for some reason the segment's length was never set, *pmtLength is set to 0.
  Windows NT/2000: Requires Windows 2000.
  Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
  Header: Declared in dmusici.h.