Hi every one
Please help me:
How can i found, if there is any disk in a removable drive (floppy drive or cd drive).
I am programming with C++Builder. If there is any Win API function for this.
Thank you very much.
Nice one. The OP asks for windows API and you give him bad C using non-standard headers.
Look up GetDriveType() and GetVolumeInformation() and SetErrorMode() and GetLastError().
Alternatively use DeviceIoControl().
Your Guides were very useful for me. My problem was solved. My main problem was this: The WinXP shows a message "No disk in CD-ROM ..." each time i reference a file in that drive. The SetErrorMode(SEM_FAILCRITICALERRORS) solved my problem.
I wrote (in C++Builder) the bellow function (Of cource WIN API have functions for this purpose but using them was very difficult and specific to each version of Windows) and tested it. It works.
Dim Adapter As New OleDbDataAdapter
Dim Command As New OleDbCommand
Dim xFrom As String = dtpFrom.Value.ToString.Substring(0, dtpFrom.Value.ToString.IndexOf(" "))
Dim xTo As String = dtpTo.Value.ToString.Substring(0, dtpTo.Value.ToString.IndexOf(" "))
sqlQuery = MainQuery ...