There seems to be some confusion when firing events in c#. Never having dealt with c#, I am also confused. I have some skeleton code to maybe help in answering this question. Can someone please help me to understand how to fire nero events in c# using nerocom as the example. What do we put and where do we put it using the following skeleton code. Thanks ahead of time.
Curtis
public class Nero : System.Windows.Forms.Form
{
public NEROLib.NeroDrive drive;
public Nero()
{
InitializeComponent();
}
private void InitializeComponent()
{
//initialize components
}
static void Main()
{
Application.Run(new Nero());
}
private void Nero_Load(object Sender, System.EventArgs e)
{
}
private void Burn_Click(object sender, System.EventArgs e)
{
try
{
drive.OnDoneBurn += new NEROLib._INeroDriveEvents_OnDoneBurnEventHandler(drive_OnDoneBurn);
//Burn CD
}
catch(Exception ex)
{
strMessages=strMessages+ex.Message+"
";
edtMessages.Text=strMessages;
}
}
public void drive_OnDoneBurn(ref NEROLib.NERO_BURN_ERROR StatusCode)
{
strMessages=strMessages+"
“+nero.ErrorLog+”
“;
strMessages=strMessages+nero.LastError+”
“;
strMessages=strMessages+“Burn Finished”;
if(StatusCode != NEROLib.NERO_BURN_ERROR.NERO_BURN_OK )
{
strMessages=strMessages+“NOT (” + StatusCode + “)”;
}
strMessages=strMessages+“successfully!”+”
";
edtMessages.Text=strMessages;
Abort.Enabled=true;
Browse.Enabled=true;
Burn.Enabled=true;
progressBar1.Value=0;
}