If i use GetVolumeInformation on a CD drive with no disc in the drive it returns 0, if I then go on to use GetLastError that also returns 0 - shouldn't it be returning some nice error code for me? or do I presume that if the result of GetVolumeInformation is 0 then there is no disc in the drive?
Heres a snippet of the code I'm using, I may be using GetLastError wrong as I've never used it before.
VB Code:
If GetVolumeInformation(sDrives(l), sLabel, 255, lSerial, 0, 0, sFilesystem, 255) = 0 Then 'Error when retrieving volume information, probably no disc in drive MsgBox GetLastError Dim sError As String * 255 FormatMessage FORMAT_MESSAGE_FROM_SYSTEM, ByVal 0&, GetLastError, LANG_NEUTRAL, sError, 255, ByVal 0& MsgBox sError End If
Help appreciated.


Reply With Quote
