Weird Problem Using Nero COM Object in VB .NET

I’m having a weird problem with Nero COM object (or COM objects in general). On the 1-in-a-million chance anybody has seen it before, I’m looking for some advice.

Long story short, in a complex set of circumstances, my Nero CD object is getting hosed after an initial successful use, and when I attempt to use it for a second time, I get a “COM object that has been separated from its underlying RCW can not be used.”

I don’t think it’s a logic problem. I’ve traced the thing that causes it to happen to something seemingly unrelated. I’ve traced it to a couple statements that declare 5M-element Char arrays between the first and second use of the Nero COM object to burn a CD. The Char arrays logically have no connection to my CD burning yet, if I comment out their declaration, the problem doesn’t occur. (I’ve narrowed it down to the fact that it is the declaration of them, not the use of them, that causes the problem.)

Any help here would be GREATLY appreciated.

Thanks,
Bill

Well, I think I figured out what the problem was. I’m curious if can tell me whether I innocently tripped or I did something really dumb. :o

The thing I was doing that was giving me the “COM object that has been separated from its underlying RCW can not be used.” was, when I did repeated CD or DVD burns, I would reinitialize my Nero object as “New Nero”. In looking at the logic, I realized there was seemingly no reason to reinstantiate the Nero object, so I took out the reinstantiation (which was the offending line). Lo and behold, everything now seems right as rain.

So my question is…are the rules of engagement such that you declare a Nero object in your program and use it for the life of the program and never reinstantiate it? (Sometimes it worked, and sometimes it didn’t.) In the NeroCOM SDK documentation, it says that declaring the Nero object is the first thing you should do. However, maybe I didn’t get an implication that it can never go away and be used again.

Any theories are welcome.

Thanks.