Go Back   Club CDFreaks - Knowledge is Power > International Chat: Software related > Nero SDK Discussion Forum


Commercial message



Nero SDK Discussion Forum Discuss, NeroCmd at International Chat: Software related forum; 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


Reply
 
Thread Tools
Old 17-06-2004   #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
timbedford is offline   Reply With Quote
Old 17-06-2004   #2 (permalink)
Nero Developer
 
Join Date: Oct 2003
Posts: 605
You could try using --no_user_interaction command line switch. Other than that, you can modify NeroCMD sources to best suit your needs.
alexp is offline   Reply With Quote
Old 21-06-2004   #3 (permalink)
New on Forum
 
Join Date: Nov 2003
Posts: 4
Re: NeroCmd

That does the trick.
thanks alex.

Tim
timbedford is offline   Reply With Quote
Old 21-03-2007   #4 (permalink)
New on Forum
 
Join Date: May 2006
Location: Germany
Posts: 11
Re: NeroCmd

How many times can I start NeroCmd per CreateProcess()?
Hawkeye_4077 is offline   Reply With Quote
Old 23-03-2007   #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.
Hawkeye_4077 is offline   Reply With Quote
Old 28-03-2007   #6 (permalink)
New on Forum
 
Join Date: May 2006
Location: Germany
Posts: 11
Re: NeroCmd

If I do burn with the Image Recorder with the same options it works fine.

What can I do or what should I do not do?
Hawkeye_4077 is offline   Reply With Quote
Old 31-01-2008   #7 (permalink)
New on Forum
 
Join Date: May 2006
Location: Germany
Posts: 11
Re: NeroCmd

One year after.

Will be an answer posted?
Hawkeye_4077 is offline   Reply With Quote
Old 01-02-2008   #8 (permalink)
New on Forum
 
Join Date: Dec 2007
Posts: 21
Re: NeroCmd

Well, I'm running 6 burners using NeroCMD. However, I run each of them be just running the NeroCMD.exe with arguments.

Can you try to run two from a command window (cmd) see how that goes?
bob1at7shore is offline   Reply With Quote
Old 01-02-2008   #9 (permalink)
New on Forum
 
Join Date: May 2006
Location: Germany
Posts: 11
Re: NeroCmd

How do you start these NeroCmd.exe in C++? With CreateProcess() or other?
Hawkeye_4077 is offline   Reply With Quote
Old 02-02-2008   #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 LaunchExeNotifyComplete;
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 notify = LaunchExeNotifyComplete;
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
bob1at7shore is offline   Reply With Quote
Old 07-02-2008   #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.
Hawkeye_4077 is offline   Reply With Quote
Old 07-02-2008   #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.
bob1at7shore is offline   Reply With Quote
Old 07-02-2008   #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.
bob1at7shore is offline   Reply With Quote
Old 14-02-2008   #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.
Hawkeye_4077 is offline   Reply With Quote
Old 16-02-2008   #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)




bob1at7shore is offline   Reply With Quote
 
Reply


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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

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


All times are GMT +2. The time now is 21:01.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0