| |||||||
| Commercial message | |
| | |
|
![]() |
| | Thread Tools |
| | #1 (permalink) |
| New on Forum Join Date: Mar 2004
Posts: 10
| Nerocom + c# + firing events to display 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+"\r\n"; edtMessages.Text=strMessages; } } public void drive_OnDoneBurn(ref NEROLib.NERO_BURN_ERROR StatusCode) { strMessages=strMessages+"\r\n"+nero.ErrorLog+"\r\n"; strMessages=strMessages+nero.LastError+"\r\n"; strMessages=strMessages+"Burn Finished"; if(StatusCode != NEROLib.NERO_BURN_ERROR.NERO_BURN_OK ) { strMessages=strMessages+"NOT (" + StatusCode + ")"; } strMessages=strMessages+"successfully!"+"\r\n"; edtMessages.Text=strMessages; Abort.Enabled=true; Browse.Enabled=true; Burn.Enabled=true; progressBar1.Value=0; } |
| | |
| | #2 (permalink) |
| New on Forum Join Date: Mar 2004
Posts: 10
| I guess there is no answer. I will post my attempts and maybe that will be useful to someone else. I have read several articles on delegating and how to treat a com object. I've tried placing the creation of the exception in the initialize components functions(I read that in a previous post). What I mean is the drive.OnDoneBurn += new NEROLib._INeroDriveEvents_OnDoneBurnEventHandler(drive_OnDoneBurn); with no success. I've read the manual for nero com several times and that object is created like so: Public WithEvents drive as NeroDrive at the top of the form. What is the equivalent to this in c#? |
| | |
| | #3 (permalink) |
| New on Forum Join Date: Mar 2004
Posts: 6
| I have found the solution to use NeroAPI with C# and NeroApiEvents. See http://club.cdfreaks.com/showthread....threadid=91378
__________________ mfg Günni |
| | |
| | #6 (permalink) |
| New on Forum Join Date: Mar 2004
Posts: 10
| The tutorial was great. Even when using the exact code in the tutorial, the progress bar does not do anything. I think my problem is when I created the new dll. I had no errors when taking it apart and changing things but I think I must be missing something. I am not sure since I was having problem reading the tutorial. From what I can gather You place the NeroCOM.dll in the same directory as tlbimp.exe. Then at the console type: tlbimp.exe NeroCOM.dll to get nerolib.dll. Next in the same directory as ildasm at the console and with nerolib.dll in the same directory type: ildasm /source nerolib.dll /output=nerolib.il to get nerolib.il and nerolib.res. Then replace private to public in all classes that have _SinkHelper in it(open nerolib.il in notepad, do a search, replace). Then use the new nerolib.il with ilasm in the console like so: ilasm /dll nerolib.il /output=nerolib_new.dll Then I think we add this new dll to our project as a reference along with the nerolib.dll. With this I still am not having any results ,in this case, with the progress bar. Any thoughts. It is likely that I missed something when I was trying to translate the tutorial. Thanks, Curtis |
| | |
| |
| |
![]() |
| 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 |
| NeroCom C++Builder Drive-Events | peterlepan | Nero SDK Discussion Forum | 0 | 19-02-2005 17:36 |
| NeroCOM events in C , please some advice | donPanucci | Nero SDK Discussion Forum | 3 | 18-01-2005 00:56 |
| Events NeroCom in C++ Builder | Tors | Nero SDK Discussion Forum | 5 | 05-05-2004 19:02 |
| Delphi 7 and NeroCOM Events | GMTyrael | Nero SDK Discussion Forum | 5 | 17-02-2004 13:53 |
| NeroCOM and .NET and events | LouClarkso | Nero SDK Discussion Forum | 7 | 19-12-2003 12:03 |