Since upgrading to Nero 18.104.22.168 I am having problems with NeroCOM from my C# app whereby I get either odd casting exceptions or exceptions to the effect of “QueryInterface for interface NEROLib.INeroDrive6 failed” etc. It’s running code that worked fine on 22.214.171.124 (apart from the bug that was fixed in 126.96.36.199 w.r.t. NeroCOM expiring and entering demo mode).
In this particular situation I’m referring to, I’m using both WaitForMedia and EjectCD. My application is such that the COM objects are created in the GUI thread but are passed to & used by another background thread that e.g. does the WaitForMedia etc. on the NeroDrive object. In other words, the user selects a drive and the GUI “waits” while the background thread does various processing operations with the associated drive. Now the issue is that as soon as the background thread tries to invoke one of those methods on the NeroDrive object the above-mentioned exceptions result.
I have done some experimentation and I have come to the following conclusion: Things seem to work if you decorate Main with [STAThread] and you use the COM objects created (e.g. NeroDrive) from the thread that created them. As soon as you use [MTAThread] (I tried this just in case) or you use the COM objects from a thread other than the one that created them, things break. Now, I’m no expert on COM at all and maybe I’m missing something, but it look to me as if from 188.8.131.52 -> 184.108.40.206 something has changed that has resulted in COM objects being “limited” to the thread that created them. Is this possible?
I would really really appreciate some brilliant suggestions to help me out… If this is a design change on Ahead’s part and not a bug, and if it’s going to be like this from now on then OK I’ll have to look for another way of doing this, but just maybe it’s a bug…?