Anyone know of the procedure or method used to check if a media (CDR and CDRW) is blank?
You should get a disc info and declare the disc empty if the track count is zero.
I try to invoke the CD info method for my burner (device #1):
When I try to capture the OnDoneCDIfo Event:
Private Sub drive_OnDoneCDInfo(pCDinfo As nerolib.neroCDInfo)
MsgBox “CD Info Call complete!”, vbOKOnly, “HEY!”
Private Sub drive_OnDoneWaitForMedia(Success As Boolean)
strMessages = strMessages + “Done waiting for media.” + Chr(13) + Chr(10)
edtMessages = strMessages
Which, like the “OnDoneWaitForMedia” event, is part of of the “NeroDrive” object. VB complains on compilings that the “Procedure declaration does not match the decription of event of the same name”. What am I missing here?
I am not sure as I am not a VB expert, but have you declared a drive variable?
Public WithEvents drive As NeroDrive
Perhaps someone with more VB experience could help… It looks alright at first glance.
“Public WithEvents drive As NeroDrive”
I thought it might be a typo? I just can’t see the problem.
Private Sub Drive_OnDoneCDInfo(ByVal pCDInfo As NEROLib.INeroCDInfo)
You seem to be missing an I in INeroCDInfo.
Why don’t you let the environment generate the proper event handler for you?
ok… i’m stuck. Anyone have some VB6 working code snippet to retrieve whether or not a CD is blank?
I try to call the CDInfo as section 8.2.5 of the NeroCOM manual says "will be provided by the OnDoneCDInfo event of the NeroDrive object, when the user has called the CDInfo event:
As you can see from the general section:
Public WithEvents nero As nero Public drives As INeroDrives Public WithEvents drive As NeroDrive Public cnt As Integer Public Folder As INeroFolder Public strMessages As String
drive is of type “NeroDrive”, as it should(?) be. When I try to write an event procedure for the OnDoneCDInfo event:
Private Sub drive_OnDoneCDInfo(pCDinfo As nerolib.neroCDInfo) MsgBox "CD Info Call complete!", vbOKOnly, "HEY!" End Sub
the VB compiler complains… “Procedure declaration does not match the decription of event of the same name”. I have tried calling:
… no complaint.
Private Sub drive_OnDoneCDInfo(pCDinfo As nerolib.neroCDInfo)… fail
Private Sub drive_OnDoneCDInfo(pCDinfo As nerolib.IneroCDInfo)… fail
i.e declaring CDInfo as type INeroDrives…
… no complaint.
Private Sub drive_OnDoneCDInfo(pCDinfo As nerolib.neroCDInfo)… COMPILES!
Private Sub drive_OnDoneCDInfo(pCDinfo As nerolib.IneroCDInfo)… COMPILES!
… but no event is ever generated.
Any suggestions at all would be appreciated…
My previous comment for you seems to have had no effect at all. Really, why not let the environment itself insert the proper handler on your behalf? If you did this, you would have gotten the following:
Private Sub drive_OnDoneCDInfo([b]ByVal[/b] pCDInfo As NEROLib.INeroCDInfo)
Please notice you are missing the ByVal keyword.
Sorry didn’t understand what you meant… don’t mean to ignore you.
As suggested, I replaced:
Private Sub drive_OnDoneCDInfo(pCDInfo As NEROLib.INeroCDInfo)
Private Sub drive_OnDoneCDInfo(ByVal pCDInfo As NEROLib.INeroCDInfo)
no event generated. Guess, I’ll keep plugging. Thanks for your help.
Anyone have a VB code sample for capturing the CDInfo form the NeroCOM object?
It seems to me you are doing only:
…while never assigning the drive variable. It is no surprise you catch no events. Do the following:
set drive = drives(1) drive.CDInfo(NERO_READ_CD_TEXT)
I must also say that drives(1) is a quite unsafe statement. I will this is for internal testing only…