I'm writing a cd player in VB6 using API calls - I have been using code to detect which track is currently playing but it doesn't appear to work.

I have created a playlist feature which means that the tracks do not have to have any particular order therefore I need to know what the ACTUAL track is rather than guess using listindexes.

The code I have been using contains this section but today it's screwing up and telling me the wrong track number - is there a better way??

mciSendString "status cd position", s, Len(s), 0
Track = CInt(Mid$(s, 1, 2))
Min = CInt(Mid$(s, 4, 2))
Sec = CInt(Mid$(s, 7, 2))