| |||||||
| Commercial message | |
| | |
|
![]() |
| | Thread Tools |
| | #1 (permalink) |
| New on Forum Join Date: Apr 2004
Posts: 4
| CDInfo - OnDoneCDInfo Hi Please forgive me if this appears twice. I'm using VB6 (SP5), XP Pro (SP2) and I have the latest version of nero installed. What I want to do is: check for a cd / dvd in the drive check if that is empty, rewritable etc.... Using the neroFilllesCOM example - I call the CDInfo and check the OnDoneCDInfo. If there is a cd / dvd in the drive I can get the info however if the drive is empty / open I get an error message. Here is my code, I think this must be a common problem and I have searched the list but I cannot figure it out can anyone please help. Thanks in advance Code: Private Sub Burn_Click() Dim drives As INeroDrives Set drives = nero.GetDrives(NERO_MEDIA_CDR) Set drive = drives(AvailableDevices.ListIndex) MsgBox drive.DriveLetter Call drive.CDInfo(NERO_READ_ISRC) 's = drive.CDRWErasingTime(True) ' Not rewritable 's = drive.EraseDisc(False, NERO_ERASE_MODE_DISABLE_EJECT) End Sub Private Sub drive_OnDoneCDInfo(ByVal pCDInfo As NEROLib.INeroCDInfo) ' If (pCDInfo = Nothing) Then ' Error invalid use of object ' If (pCDInfo = Null) Then ' Runtime error 91; Object variable or With block variable not set If (pCDInfo.Tracks.Count > 0) Then MsgBox "Is Writable: " & pCDInfo.IsWriteable MsgBox "MediaType: " & pCDInfo.MediaType MsgBox "Tracks: " & pCDInfo.Tracks.Count Else MsgBox "No Tracks: CD / DVD Empty" End If Else MsgBox "No CD / DVD" End If End Sub |
| | |
| | #3 (permalink) |
| New on Forum Join Date: Apr 2004
Posts: 4
| Re: CDInfo - OnDoneCDInfo Thanks, In my code I have tried this If (pCDInfo = Nothing) Then and I keep getting the following error : Error invalid use of object If (pCDInfo = Null) Then and I get: Runtime error 91; Object variable or With block variable not set |
| | |
| | #5 (permalink) |
| Nero Developer Join Date: Oct 2003
Posts: 605
| Actually, it should be something along the lines of: Code: If Not (pCDInfo Is Nothing) Then . . . End If PGavin's original post seems to imply that exactly the opposite has been used. |
| | |
| | #6 (permalink) |
| CD Freaks Member Join Date: Dec 2003 Location: uk
Posts: 234
| Re: CDInfo - OnDoneCDInfo In actual fact, the NOT is irrelevant as long as the if statement is used correctly. For example: If pCDInfo Is Nothing Then MsgBox "No Disk Inserted, Please Insert Disk Then Try Again!" NumExistingTracks = -1 DriveFinished = True Exit Sub End If ' code for when disc is present |
| | |
| |
| |
![]() |
| If you can't find where you are looking for, then become a member and get an answer fast! We have thousands of people online every moment of the day to help you! Click here |
| Bookmarks |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Returning OnDoneCDInfo | dthomson | Nero SDK Discussion Forum | 1 | 26-03-2006 15:14 |
| Msgbox causes OnDoneCDInfo to be called again and again | Raffael Walther | Nero SDK Discussion Forum | 5 | 26-07-2005 15:15 |
| OnDoneCDInfo?(NeroCom) | Tors | Nero SDK Discussion Forum | 5 | 04-05-2004 01:41 |
| NeroCom CDInfo | lespaul36 | Nero SDK Discussion Forum | 3 | 08-04-2004 09:38 |
| vb.net + NeroCOM + onDoneCdInfo | tarlik | Nero SDK Discussion Forum | 2 | 25-03-2004 16:53 |