#1 Burning Software

It is currently Fri Mar 29, 2024 2:19 am

All times are UTC




Post new topic Reply to topic  [ 13 posts ] 
Author Message
 Post subject: Disk doesn't burn
PostPosted: Wed Oct 21, 2009 5:51 pm 
Offline

Joined: Mon Jun 22, 2009 3:37 pm
Posts: 7
I am using the StarBurnX COM object to burn CDs. The code had been working, but I went in and was adjusting it to fit StyleCop and FxCop format and now it does not work. I have used the sample CD Burning project to verify that my CD burner is working. The burn produces progress, and even verifies, but the file is not being written to disk. I am not burning a test track (I don't think. I hard-coded that to false).

The setup code is as follows:

private void BurnBackup()
{
_dataBurner.AddFile("C:\\Temp\\Test.bak");

// Collect information about the current selected drive
_dataBurner.NextSessionAllowed = false;

DriveInfo driveInfo = _dataBurner.Drive.DriveInfo;

driveInfo.Refresh();

// Set the selected write speed
_dataBurner.WriteSpeed = driveInfo.WriteSpeed;

// Test, whether drive is ready to burn
if (_dataBurner.Drive.State != STARBURN_DRIVE_STATE.STARBURN_DRIVE_STATE_READY)
{

MessageBox.Show("Not ready to burn!");
return;
}

// Set the burn method
_dataBurner.Mode = STARBURN_WRITE_MODE.STARBURN_WRITE_MODE_AUTO;

// Lock Tray
_dataBurner.LockTray = true;

// Start thread
Thread burningThread = new Thread(new ThreadStart(DoBurn));
burningThread.Start();
}

the DoBurn is as follows:


protected void DoBurn()
{
// Do burning
try
{
_dataBurner.Burn(false, DEF_VOLUME_NAME, "StarBurnX", "StarBurnX Data Burner");
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}

I receive progress, and the CD verifies, but the file is not written to the CD.

Any help would be appreciated. Thanks.


Top
 Profile  
 
 Post subject: Re: Disk doesn't burn
PostPosted: Wed Oct 21, 2009 6:44 pm 
Offline
Site Admin

Joined: Fri Jun 18, 2004 12:03 am
Posts: 4089
Location: British Virgin Islands
I'm not a big StarBurnX expert so please provide us with StarBurn debug log. It's gonna help more then your source snippet ))


Top
 Profile  
 
 Post subject: Re: Disk doesn't burn
PostPosted: Thu Oct 22, 2009 11:39 am 
Offline

Joined: Mon Jun 22, 2009 3:37 pm
Posts: 7
Log file:
=================================================

< Junk removed by Moderator >

=======================================================
With logging enabled, the process will not exit. Without logging, I get a COM exception when the process exits (after burning is supposedly done).

Thanks.


Top
 Profile  
 
 Post subject: Re: Disk doesn't burn
PostPosted: Thu Oct 22, 2009 11:45 am 
Offline
Site Admin

Joined: Fri Jun 18, 2004 12:03 am
Posts: 4089
Location: British Virgin Islands
starburn-sdk-f3/logs-forum-messages-please-t741.html


Top
 Profile  
 
 Post subject: Re: Disk doesn't burn
PostPosted: Thu Oct 22, 2009 12:04 pm 
Offline

Joined: Mon Jun 22, 2009 3:37 pm
Posts: 7
I am going to try to attach the file. It is too large to paste into a reply.


Attachments:
StarBurn.zip [8.77 KiB]
Downloaded 709 times
Top
 Profile  
 
 Post subject: Re: Disk doesn't burn
PostPosted: Thu Oct 22, 2009 12:15 pm 
Offline
Site Admin

Joined: Fri Jun 18, 2004 12:03 am
Posts: 4089
Location: British Virgin Islands
I see a lot of strange things you do... You burn then you try to verify (w/o closing session) then you close session. It's not gonna work... Did you manage to build any shipped with StarBurn SDK samples (StarBurnX ones) and burn with them?


Top
 Profile  
 
 Post subject: Re: Disk doesn't burn
PostPosted: Thu Oct 22, 2009 2:02 pm 
Offline

Joined: Mon Jun 22, 2009 3:37 pm
Posts: 7
I am doing the verify synchronously. I can make that asynchronous if it needs to be. I commented out the entire verify code, and I am still not getting my file to burn properly. I have another issue that has cropped up since I enabled logging. The process that I've written will not terminate after I burn the backup. I have to stop the process using the debugger. I think that this is simply another symptom to the problem, as the C# example that comes with the StarBurn SDK will terminate properly.

Any assistence would be appreciated. Thanks.


Top
 Profile  
 
 Post subject: Re: Disk doesn't burn
PostPosted: Thu Oct 22, 2009 4:10 pm 
Offline
Site Admin

Joined: Fri Jun 18, 2004 12:03 am
Posts: 4089
Location: British Virgin Islands
You cannot verify content before you finalize the disc. So you need to:

1) Burn data
2) Close the disc
3) Run verify sequence (does not matter sync or async)

Please check your code and I'll ask Dima to make sure it's not StarBurnX wrapper issue.

Thanks!


Top
 Profile  
 
 Post subject: Re: Disk doesn't burn
PostPosted: Thu Oct 22, 2009 5:31 pm 
Offline

Joined: Mon Jun 22, 2009 3:37 pm
Posts: 7
I have looked in both the C# example and VB.Net example and I can't find in either where the data burner explicitly closes the disk. Both examples use asynchronous threads to write and verify the disks. I have modified my code to follow this pattern and it is working, but I want to make sure there isn't something that I am missing.

Something is keeping the file that I am writing to disk in use. I can't overwrite it or delete it after I've burned the disk until I close the process down. That would potentially be caused by the same thing, not explicitly closing the disk.

Thanks.


Top
 Profile  
 
 Post subject: Re: Disk doesn't burn
PostPosted: Thu Oct 22, 2009 10:57 pm 
Offline
Site Admin

Joined: Fri Jun 18, 2004 12:03 am
Posts: 4089
Location: British Virgin Islands
1) I'll ask Dima (StarBurnX & .NET wrapper and samples developer) to check your project source this Monday.

2) If you have files locked this means component tree object was not destroyed.


Top
 Profile  
 
 Post subject: Re: Disk doesn't burn
PostPosted: Mon Oct 26, 2009 4:36 pm 
Offline

Joined: Thu Dec 13, 2007 8:44 am
Posts: 609
Hello,

1) Yes, you cannot delete/modify files after you have burned these files on disc but you can burn these files on different discs ( many times)!
2) Files will stay locked until the DataBurner instance is not destroyed!
3) Do not call the Verify process until the burner thread is not finished! Session will be closed automatically! ( see the OnCloseSessionBegin & OnCloseSessionEnd events ).
4) Disc will be finalized if value of the property NextSessionAllowed is false!

Regards,

Dmitry


Top
 Profile  
 
 Post subject: Re: Disk doesn't burn
PostPosted: Mon Oct 26, 2009 5:50 pm 
Offline

Joined: Mon Jun 22, 2009 3:37 pm
Posts: 7
Dmitry,

Hello. I think we are missing each other's meanings somehow. What I am trying to do is close the session. I need to be able to use this instance of the databurner (or another instance, I don't care) to add new files and burn new disks. Think of a system that occasionally will burn a database backup to CD. The system will continue to operate while the backup is burned and when it is finished. The burning process itself will not close. I am using the DataBurner class to do my burning with. I can add files, but only when the class is first instanciated. It will burn the first time through just fine. Then I need to verify that the files successfully burned. It is fine if this finalizes the disk as well. Nothing more will be burned on this disk.

If I need to dispose of the databurner class I can, but it does not implement the Dispose pattern or IDisposible. Do I need to do anything other than set it to null to dispose of it?

Nothing that I am working with has an OnCloseSessionBegin event to tie into. What class are you referring to? Should I be using a different class? I have to admit, I am somewhat confused. These seem like reasonable events for me to tap into, but the DataBurned class does not expose any such event, nor is such an event present in your help files. Your help file references an IUDFDataBurnerEvents::OnCloseSessionBegin, but all it says is "Do not modify the target object inside of this handler because it may cause deadlock !!"

In any event, what I need to be able to do is close out the session and be able to add files again. When I try right now I get an error "Wrong image State: Operation cannot be performed because the image tree is built!" Would destroying the databurner object help this? If so, how should I destroy it?

Thanks,

--Steve


Top
 Profile  
 
 Post subject: Re: Disk doesn't burn
PostPosted: Tue Oct 27, 2009 5:13 pm 
Offline

Joined: Thu Dec 13, 2007 8:44 am
Posts: 609
Hello,

1) StarBurnX objects don't implement IDisposable interface because the StarBurnX is COM! You work with StarBurnX through the "Interop" technique!

2) You MUST destroy the "dirty" DataBurner object ...

Marshal.ReleaseComObject(m_dataBurner);

m_dataBurner = null;

... and create new DataBurner object!!

3) The OnCloseSessionBegin & OnCloseSessionEnd events were recently added. You may try to load latest update of StarBurnX from our ftp site:

link was removed

1) Unpack & register new version of StarBurnX
2) Remove the RocketDivision.StarBurnX.Interop2 referense from you .NET application
3) Add reference on newly registered StarBurnX component :
[Add Reference ...]->[COM]->StarBurnX 10.0 Type library

Regards,

Dmitry


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 22 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group