| |||||||
| Commercial message | |
| | |
|
![]() |
| | Thread Tools |
| | #1 (permalink) |
| New on Forum Join Date: Jul 2004
Posts: 19
| Getting intermittent errors with NeroDrive Around 1 time in 5 I get error messages when working with NeroDrive objects. The message is "The callee (server [not server application]) is not available and disappeared; all connections are invalid. The call did not execute". I have tried to modify my code in several ways, but the message keeps appearing. I am using the 6.6.0.3 version. I am using NeroCOM with C# in Visual Studio 2003. |
| | |
| | #2 (permalink) |
| Nero Developer Join Date: Oct 2003
Posts: 605
| Is this VS 7 or VS 7.1? There were some problems with earlier versions of Visual Studio .NET. Also, there were problems with previous versions of NeroCOM but these were solved. NeroCOM was extensivelly tested with C# and .NET and no further problems were found. Can you please show some related code or possibly try to dig more on the issue? It is hard to say anything just from that single error. No such thing ever happened to us during testing. |
| | |
| | #3 (permalink) |
| New on Forum Join Date: Jul 2004
Posts: 19
| Re: Getting intermittent errors with NeroDrive Hi, Thank you for responding. The problems I have are with Visual Studio .NET 2003. I also have the latest Nero version installed. Note: just to be sure, could you tell me the file-version and size of NeroCom.dll. I had previous versions on my system, and I want to be sure that the update went well. |
| | |
| | #6 (permalink) |
| Nero Developer Join Date: Oct 2003
Posts: 605
| That sounds about right. Now, what about that code? We must find something suspicious as our own C# application works flawlessly. Do you get your error 1 in 5 times you run your application consecutivelly or does it happen all in one single run? |
| | |
| | #7 (permalink) |
| New on Forum Join Date: Jul 2004
Posts: 19
| Re: Getting intermittent errors with NeroDrive The error occurs JUST AFTER I subscribe to the events of the NeroDrive object. I am 100% sure that it has to do with the subscription of events, because I moved the function to different places, and the error always occurred in these places. I use a methods for this: internal void SubscribeToActiveDriveEvents() { try { Nero.App.ActiveDriveNeroObject.OnAborted += new _INeroDriveEvents_OnAbortedEventHandler(activeDrive_OnAborted); Nero.App.ActiveDriveNeroObject.OnAddLogLine += new _INeroDriveEvents_OnAddLogLineEventHandler(activeDrive_OnAddLogLine); Nero.App.ActiveDriveNeroObject.OnDoneBurn += new _INeroDriveEvents_OnDoneBurnEventHandler(activeDrive_OnDoneBurn); Nero.App.ActiveDriveNeroObject.OnDoneCDInfo += new _INeroDriveEvents_OnDoneCDInfoEventHandler(activeDrive_OnDoneCDInfo); Nero.App.ActiveDriveNeroObject.OnDoneEstimateTrackSize += new _INeroDriveEvents_OnDoneEstimateTrackSizeEventHandler(activeDrive_OnDoneEstimateTrackSize) ; Nero.App.ActiveDriveNeroObject.OnMajorPhase += new _INeroDriveEvents_OnMajorPhaseEventHandler(activeDrive_OnMajorPhase); Nero.App.ActiveDriveNeroObject.OnProgress += new _INeroDriveEvents_OnProgressEventHandler(activeDrive_OnProgress); Nero.App.ActiveDriveNeroObject.OnSubTaskProgress += new _INeroDriveEvents_OnSubTaskProgressEventHandler(activeDrive_OnSubTaskProgress); Nero.App.ActiveDriveNeroObject.OnSetPhase += new _INeroDriveEvents_OnSetPhaseEventHandler(activeDrive_OnSetPhase); Nero.App.ActiveDriveNeroObject.OnDoneErase += new _INeroDriveEvents_OnDoneEraseEventHandler(activeDrive_OnDoneErase); } catch (Exception ex) { throw new ApplicationException("error subscribing to the Nero Drive events for drive " + Nero.App.ActiveDriveNeroObject.DeviceName, ex); } } As you can see, exceptions are caught. However, it is NOT the exception handler in this method that catches the error, it is the exception handler of the calling method. The exception is thrown somewhere AFTER the SubscribeToActiveDriveEvents methods has completed. VERY STRANGE ! |
| | |
| | #8 (permalink) |
| New on Forum Join Date: Jul 2004
Posts: 19
| Re: Getting intermittent errors with NeroDrive Hi, Thanks for your technical support so far, but I have found the solution to my problem. The problem is related to the threading-model used in .NET. My main thread is marked as [MTAThread]. I had to do this for other reasons. When COM is run in a single-threaded apartment, there is no problem. So in order to solve this problem, I have to use all Nero COM objects in the context of a STA thread. I can do this by creating a new Thread object in .NET, and set its ApartmentState to STAThread. |
| | |
| | #9 (permalink) |
| Nero Developer Join Date: Oct 2003
Posts: 605
| Good that you have found the cause of the problem. On the other hand, that is quite strange as it shouldn't really happen. .NET should internally marshal COM pointers according to COM rules. It seems as if something is broken there. |
| | |
| | #10 (permalink) |
| New on Forum Join Date: Jul 2004
Posts: 19
| Re: Getting intermittent errors with NeroDrive Hi, I don't think anything is broken. The MTAThread and STAThread attributes of a .NET thread determine how the COM objects will be called by .NET. See http://www.sellsbrothers.com/askthew...hreadattri.htm for more info. |
| | |
| | #11 (permalink) |
| Nero Developer Join Date: Oct 2003
Posts: 605
| If what you say is correct, then there is major problem. Each COM object (coclass) has a registry setting that says how it MUST be activated. This is not down to .NET to decide but is mandated by the COM object's designer. It is very wrong to treat all COM objects as MTA just because they are created from MTA. It seems as if .NET is sometimes bending some rules when it comes to COM. There is NO reason why your code shouldn't work even if all the .NET code belongs to a MTA. NeroCOM is all STA and therefore, .NET should work with proxies and the STA that NeroCOM objects live in, would be owned by the system. There is nothing wrong with this concept, and yet it does not work as your example clearly showed. So, something is not right with COM and .NET. |
| | |
| | #12 (permalink) |
| New on Forum Join Date: Jul 2004
Posts: 19
| Re: Getting intermittent errors with NeroDrive You are probably right. If all Nero Objects must live in an STA, then .NET must take care of creating that STA. If my application runs in an MTA, then there is marshaling between the MTA and the STA. Perhaps there is a problem in the marshaling ? |
| | |
| |
| |
![]() |
| 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 |
| NeroDrive Probleme | tommazzo | Nero SDK Discussion Forum | 12 | 01-11-2005 23:13 |
| casting INeroDrive to NeroDrive | yoss05 | Nero SDK Discussion Forum | 0 | 30-10-2005 10:18 |
| C#, NeroDrive, Eventhandlers | tmoravan | Nero SDK Discussion Forum | 4 | 06-09-2005 22:36 |
| How to call NeroDrive.EstimateTrackSize | ae_srikanth | Nero SDK Discussion Forum | 0 | 25-08-2005 14:05 |
| NeroDrive.OnDriveStatusChanged is silent | yanush | Nero SDK Discussion Forum | 4 | 15-07-2005 18:38 |