| |||||||
| Commercial message | |
| | |
|
![]() |
| | Thread Tools |
| | #1 (permalink) |
| New on Forum Join Date: Nov 2003
Posts: 4
| NeroCmd Hi, I'm developing an application (C++ Builder on Windows XP/2000) in which users can select certain files and burn them to CD. I'm executing the command-line (--write --real --disable_eject --drivename D -iso ATCS files) using the CreateProcess API call, then WaitForSingleObject (with INFINITE wait) to catch when it finishes and finally GetExitCodeProcess to check it was ok. If the user has inserted a blank CD it works fine, but if they insert one that's already been used (and closed) NeroCmd just waits forever for them to insert a blank one (i.e. WaitForSingleObject is never called). Ideally I'd like NeroCmd to return instantly with a useful exit code. I presume there isn't a command-line switch to get it to do this? Alternatively I could use WaitForSingleObject with a finite wait period but I don't know how long that should be. Has anyone else dealt with this? Any suggestions? TIA Tim |
| | |
| | #5 (permalink) |
| New on Forum Join Date: May 2006 Location: Germany
Posts: 11
| Re: NeroCmd I started two NeroCmd's with different drives and source folders to burn. The burn process was both successfull but at the end to close the console of the second process a Runtime Error occurs: "nerocmd.exe; R6025: Pure virtual function call". If I do these processes one after the other everthing is ok. |
| | |
| | #10 (permalink) |
| New on Forum Join Date: Dec 2007
Posts: 21
| Re: NeroCmd Notice, I run each burner in a new process from a new thread. First, for a sanity check, without code... did you open two cmd windows and run a burner in each? C# code: using System; using System.Collections.Generic; using System.Text; using System.Diagnostics; using System.Threading; namespace ManageDvd { public class LaunchExeEventArgs : EventArgs { private String message; // A message from the Launched program private int managedThreadId; // Identifies the thread who set the event public LaunchExeEventArgs(String Message, int ManagedThreadId) { message = Message; managedThreadId = ManagedThreadId; } public String Message { get { return message; } } public int ManagedThreadId { get { return managedThreadId; } } } public struct LaunchExeThreadParameters // Thread Parameters to bob/unbox { public string exeName; public string argsLine; public int timeout; public LaunchExeThreadParameters(string p1, string p2, int p3) { exeName = p1; argsLine = p2; timeout = p3; } } public class LaunchExe { public event EventHandler public void Exe(object box) { LaunchExeThreadParameters unbox = (LaunchExeThreadParameters)box; string Msg = @"LaunchExe: " + unbox.exeName + @" "; try { Process newProcess = new Process(); newProcess.StartInfo.FileName = unbox.exeName; newProcess.StartInfo.Arguments = unbox.argsLine; newProcess.StartInfo.UseShellExecute = true; newProcess.Start(); if (0 == unbox.timeout) { newProcess.WaitForExit(); Msg += @"Finished"; } else { bool success = newProcess.WaitForExit(unbox.timeout); if (success) { Msg += @"Finished"; } else { Msg += "Timed out at " + unbox.timeout + "ms"; } } } catch (Exception e) { Msg += "Error"; throw (new Exception(Msg, e)); } finally { // TODO: does creating notify really make this thread safe? EventHandler if (notify != null) { notify(this, new LaunchExeEventArgs(Msg, Thread.CurrentThread.ManagedThreadId)); } } } } } using System; using System.Collections.Generic; using System.Text; using System.Threading; namespace ManageDvd { class BurnCopiesDVD { public void BurnSlaveDVDnow(string SlaveDriveLetter, string StorageDrivePath, bool test) { string VIDEO_TS = (string)StorageDrivePath + @"\DVD_VIDEO_RECORDER\VIDEO_TS"; LaunchExeThreadParameters P; P.exeName = @"B:\VS\cmdVersions\NeroCMD\Bin\NeroCMD.exe"; P.timeout = (60 * 10 * 1000); P.argsLine = "--drivename " + SlaveDriveLetter; P.argsLine += " --write"; P.argsLine += " --dvd"; P.argsLine += " --iso DVD-VIDEO"; P.argsLine += " --create_iso_fs"; P.argsLine += " --create_udf_fs"; P.argsLine += " --iso_no_joliet"; P.argsLine += " --dvdvideo_realloc"; P.argsLine += " --recursive " + VIDEO_TS; P.argsLine += " --speed 8"; P.argsLine += " --underrun_prot"; P.argsLine += " --dvdvideo_cmpt"; P.argsLine += " --no_user_interaction"; P.argsLine += " --dvd_high_compatibility"; P.argsLine += " --media_type media_dvd_m_r"; P.argsLine += " --booktype_dvdrom"; if (!test) { P.argsLine += " --real"; } LaunchExe Launch = new LaunchExe(); // Run in a new Thread Thread Run_NeroCMD = new Thread(new ParameterizedThreadStart(Launch.Exe)); Run_NeroCMD.Start(P); } } } snipit from calling class: BurnCopiesDVD bDVD; String NewDVDPathName; bDVD = new BurnCopiesDVD(); private void button2_Click(object sender, EventArgs e) { button2.Enabled = false; bDVD.BurnSlaveDVDnow(@"G:", @"D:" + NewDVDPathName, Test.Checked); bDVD.BurnSlaveDVDnow(@"H:", @"D:" + NewDVDPathName, Test.Checked); bDVD.BurnSlaveDVDnow(@"I:", @"D:" + NewDVDPathName, Test.Checked); bDVD.BurnSlaveDVDnow(@"J:", @"D:" + NewDVDPathName, Test.Checked); button2.Enabled = true; } Last edited by bob1at7shore; 02-02-2008 at 05:30. Reason: added calling function |
| | |
| | #11 (permalink) |
| New on Forum Join Date: May 2006 Location: Germany
Posts: 11
| Re: NeroCmd So do I. But I have to wait (WaitForSingleObject()) until the burn process ends so I can start the next one. "...did you open two cmd windows and run a burner in each?" If I didn't wait, I have to do so. The burning process is well done in each window but if the second process ends, the error occurs and I can't close the second window. I have to reboot. |
| | |
| | #12 (permalink) |
| New on Forum Join Date: Dec 2007
Posts: 21
| Re: NeroCmd Please clarify... Did you try running NeroCMD in two CMD windows, 1 burn in each? (This is just NeroCMD, not running from your code) (WaitForSingleObject()) is in your code. We should first verify that NeroCMD can run from more than one command window. I think you are are saying that the CMD windows work but running two proceses from two new threads in your code will not work. I am using vista, what os are you using? What version Nero are you using? I am on Nero8. I actually saw your problem with NeroCom/.NET. That is why I am using NeroCMD now. |
| | |
| | #13 (permalink) |
| New on Forum Join Date: Dec 2007
Posts: 21
| Re: NeroCmd Please clarify... Did you try running NeroCMD in two CMD windows, 1 burn in each? (This is just NeroCMD, not running from your code) (WaitForSingleObject()) is in your code. We should first verify that NeroCMD can run from more than one command window. I think you are are saying that the CMD windows work but running two proceses from two new threads in your code will not work. I am using vista, what os are you using? What version Nero are you using? I am on Nero8. I actually saw your problem with NeroCom/.NET. That is why I am using NeroCMD now. |
| | |
| | #14 (permalink) |
| New on Forum Join Date: May 2006 Location: Germany
Posts: 11
| Re: NeroCmd I didn't try to run two NeroCMDs separatly. I can start two NeroCMD-Windows to burn two different source paths from my code. The burn process is successful but when the second window will close the error of virtual function call occurs. You wrote: "I think you are are saying that the CMD windows work but running two proceses from two new threads in your code will not work." Why not or would you say I can run just one thread to keep my dialog up to date and I can start two NeroCmds within this thread. I am using XP Pro and Nero 6 Reloaded. The version of NeroCmd is 2.0.0.2 and API version is 6.6.1.4. |
| | |
| | #15 (permalink) |
| New on Forum Join Date: Dec 2007
Posts: 21
| Re: NeroCmd I can't say I know what is wrong but I always try to find an approach that does work then go from there. If you have VS2005, you can try the c# code I gave you above. See if that works. If you are a C++ programmer, C# is easy. For VB, it's about the same. Did you read the "NeroCom and DVD-Video" thread? It may be that each instance of the nero burning engine needs it's own heap space. For example, if they have static variables maybe they intend for them to only be static for 1 burner, not more than 1. Each burner may need it's own statics, not shared between burners. Maybe your code is causeing static variables to get mixed up? I'm only guessing. I am running a multi processor machine. On a single processor machine, are the threads deadlocking and then aborting? Or, the opposite, some mutex is mssing. Would you like to post your code? It will me take me a while to get to it but I'll have a look. (I'm just learning all of this myself) |
| | |
| |
| |
![]() |
| 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 |
| NeroCmd | Andrew23 | Nero SDK Discussion Forum | 0 | 24-06-2007 20:17 |
| NeroCmd | socram | Nero SDK Discussion Forum | 2 | 12-09-2005 17:27 |
| NeroCMD | Tador | Nero SDK Discussion Forum | 2 | 03-08-2005 15:34 |
| [nerocmd] burning multi session dvd problem with NeroCmd | coolhome | Nero SDK Discussion Forum | 0 | 21-07-2005 04:11 |
| [nerocmd] | Goof | Nero SDK Discussion Forum | 3 | 18-08-2004 15:03 |