Results 1 to 12 of 12

Thread: writing to a CD

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2000
    Posts
    2
    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??

  2. #2
    Junior Member
    Join Date
    Jan 2003
    Posts
    21
    There's this thread that almost has 3 years and hasn't got an answer. Was it forgotten or no one knows an answer?

    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??

  3. #3
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190
    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...

  4. #4
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    Well

    VB Code:
    1. 'to determine the presence of a CD
    2. 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
    3.  
    4. Private Function IsCDInDrive(ByVal strCDDriveLetter As String) As Boolean
    5.    Dim strStatus As String * 128
    6.    'open the device
    7.    mciSendString "open " & strCDDriveLetter & ": type cdaudio alias cddrive wait", vbNullString, 0, 0
    8.    'see if there's something in the drive
    9.    mciSendString "status cddrive media present", strStatus, Len(strStatus), 0
    10.    'close the device
    11.    mciSendString "close cddrive", vbNullString, 0, 0
    12.    'the string will contain "true" or "false" which can be easily converted
    13.    IsCDInDrive = CBool(Left$(strStatus, InStr(strStatus, vbNullChar) - 1))
    14. End Function
    15. 'to determine the volume name of the CD
    16. 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
    17. Private Sub Form_Load()
    18.     'KPD-Team 1998
    19.     'URL: [url]http://www.allapi.net/[/url]
    20.     'E-Mail: [email][email protected][/email]
    21.     Dim Serial As Long, VName As String, FSName As String
    22.     'Create buffers
    23.     VName = String$(255, Chr$(0))
    24.     FSName = String$(255, Chr$(0))
    25.     'Get the volume information
    26.     GetVolumeInformation "C:\", VName, 255, Serial, 0, 0, FSName, 255
    27.     'Strip the extra chr$(0)'s
    28.     VName = Left$(VName, InStr(1, VName, Chr$(0)) - 1)
    29.     FSName = Left$(FSName, InStr(1, FSName, Chr$(0)) - 1)
    30.     'change E:\ with the CD drive letter
    31.     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
    32. End Sub

    Then supply error code to handle to trying to write to non-writable CD
    Remaining quiet down here !!!

    BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....

  5. #5
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190
    James....will that work with all CD-Burners?

  6. #6
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    Well

    Originally posted by NoteMe
    James....will that work with all CD-Burners?
    Move to Theory - Land. Everything works there...

    Seriously, I have know way of knowing.
    Remaining quiet down here !!!

    BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....

  7. #7
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190
    Theory Land - I suppose that is in the same street as MS Win was made...... maybe I should test it and tell you if it works....but I have no time today...so maybe tomorrow...

  8. #8
    Junior Member Pvzbis's Avatar
    Join Date
    Dec 2002
    Posts
    26
    You want write file in CD every times user insert it?
    Why do this???
    Don't sound good!!!

  9. #9
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190
    Originally posted by Pvzbis
    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...

  10. #10
    Frenzied Member dis1411's Avatar
    Join Date
    Mar 2001
    Posts
    1,048
    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

  11. #11
    Frenzied Member dis1411's Avatar
    Join Date
    Mar 2001
    Posts
    1,048
    hey what the heck? i dont think MartinLiss is going to like your avatar..

  12. #12
    Member
    Join Date
    Sep 2003
    Posts
    56
    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...)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width