I am tying to make a program that, among other things, checks that there is a cd recorder attached and then writes data to a cd.
does anyone have any idea about how i could do this??
Printable View
I am tying to make a program that, among other things, checks that there is a cd recorder attached and then writes data to a cd.
does anyone have any idea about how i could do this??
There's this thread that almost has 3 years and hasn't got an answer. Was it forgotten or no one knows an answer?
Quote:
Originally posted by solly
I am tying to make a program that, among other things, checks that there is a cd recorder attached and then writes data to a cd.
does anyone have any idea about how i could do this??
It depends on what kind of CD-Burner you have...I have heard about somone used a controll/API from NERO. That worked on some burners...
VB Code:
'to determine the presence of a CD Private Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long Private Function IsCDInDrive(ByVal strCDDriveLetter As String) As Boolean Dim strStatus As String * 128 'open the device mciSendString "open " & strCDDriveLetter & ": type cdaudio alias cddrive wait", vbNullString, 0, 0 'see if there's something in the drive mciSendString "status cddrive media present", strStatus, Len(strStatus), 0 'close the device mciSendString "close cddrive", vbNullString, 0, 0 'the string will contain "true" or "false" which can be easily converted IsCDInDrive = CBool(Left$(strStatus, InStr(strStatus, vbNullChar) - 1)) End Function 'to determine the volume name of the CD Private Declare Function GetVolumeInformation Lib "Kernel32" Alias "GetVolumeInformationA" (ByVal lpRootPathName As String, ByVal lpVolumeNameBuffer As String, ByVal nVolumeNameSize As Long, lpVolumeSerialNumber As Long, lpMaximumComponentLength As Long, lpFileSystemFlags As Long, ByVal lpFileSystemNameBuffer As String, ByVal nFileSystemNameSize As Long) As Long Private Sub Form_Load() 'KPD-Team 1998 'URL: [url]http://www.allapi.net/[/url] 'E-Mail: [email][email protected][/email] Dim Serial As Long, VName As String, FSName As String 'Create buffers VName = String$(255, Chr$(0)) FSName = String$(255, Chr$(0)) 'Get the volume information GetVolumeInformation "C:\", VName, 255, Serial, 0, 0, FSName, 255 'Strip the extra chr$(0)'s VName = Left$(VName, InStr(1, VName, Chr$(0)) - 1) FSName = Left$(FSName, InStr(1, FSName, Chr$(0)) - 1) 'change E:\ with the CD drive letter MsgBox "The Volume name of E:\ is '" + VName + "', the File system name of E:\ is '" + FSName + "' and the serial number of E:\ is '" + Trim(Str$(Serial)) + "'", vbInformation + vbOKOnly, App.Title End Sub
Then supply error code to handle to trying to write to non-writable CD
James....will that work with all CD-Burners?
Move to Theory - Land. Everything works there...Quote:
Originally posted by NoteMe
James....will that work with all CD-Burners?
Seriously, I have know way of knowing. :(
Theory Land - I suppose that is in the same street as MS Win was made...:p... maybe I should test it and tell you if it works....but I have no time today...so maybe tomorrow...:)
You want write file in CD every times user insert it?
Why do this???
Don't sound good!!!
That was ot what I asked for. You are way off....but you not yet told me what you are going to use exe binding for...Quote:
Originally posted by Pvzbis
You want write file in CD every times user insert it?
Why do this???
Don't sound good!!!
what id really like to know is if you can make a prog burn over already burned info on a cd-r, sort of a cd-r shredder if you will
hey what the heck? i dont think MartinLiss is going to like your avatar..
I didn't understand what James Stanich did...
solly needed a program that will burn a file to a cd (and actually, I do too...)