INTERACT FORUM

Windows => Plug-in Development => Topic started by: earache on October 08, 2003, 12:32:15 am

Title: COM/Ole Automation No Worky
Post by: earache on October 08, 2003, 12:32:15 am
Maybe I'm a total idiot, but I've tried both Delphi 7 and C#/.NET to control Media Center via out of process automation.

In both environments I get a "Class not registered" error, or one of a similar nature.

Am I missing something?  Do I have to regsvr32 something?
Title: Re: COM/Ole Automation No Worky
Post by: Nikolay on October 08, 2003, 05:26:51 am
earache,

You receive the message because you are trying to use GetActiveObject. If you receive the error from the function call CreateInstance.

For more info see MJAutomation documentation:
http://www.musicex.com/mediacenter/DevZone/MJAutomation.html

Nikolay
Title: Re: COM/Ole Automation No Worky
Post by: earache on October 08, 2003, 09:56:26 am
I get it both ways.

In delphi,

var test:Variant;

test=CreateOleObject("MediaJukebox Application");

That yeilds a "Invalid class string".  Doing it with GetActiveOleObject() gets the same error.

In C#, I've used the standard:

IMJAutomation mj=new MJAutomation();

and

IMJAutomation mj=(IMJAutomation)System.Runtime.InteropServices.Marshal.GetActiveObject("MediaJukebox Application");

Both yielding in class not registered errors.  I suspect this is a registry issue?  I dunno.  I'm confused.

Thanks :)
Title: Re: COM/Ole Automation No Worky
Post by: JeffreyK on October 08, 2003, 01:50:47 pm
What build of MediaCenter are you using?

Have you tried rebooting the machine?  I have run into errors before with OLE that go away with a reboot (especially just after installing new software or running into a crash in an app using OLE).

-JeffreyK
Title: Re: COM/Ole Automation No Worky
Post by: earache on October 08, 2003, 04:45:03 pm
Media Center Registered 9.0.180

I've tried rebooting, but no go.  Wondering if I should re-install it.  

I've scanned my registry for MediaCenter but there is nothing that indicates any type of OLE Automation Server has been registered.  

Are there registry settings I should try?
Title: Re: COM/Ole Automation No Worky
Post by: earache on October 08, 2003, 05:08:20 pm
Installed the update and everything is working cool now.  I think my problem is that when I reinstalled XP after a nasty system crash, I just copied the folder over and didn't reinstall.

Thanks! :)
Title: Re: COM/Ole Automation No Worky
Post by: JeffreyK on October 09, 2003, 06:34:42 am
The problem was that .180 didn't have the out of proc automation - that was added during the development of 9.1.

Glad things are working!
-JeffreyK
Title: Re: COM/Ole Automation No Worky
Post by: earache on October 09, 2003, 07:00:27 am
That might explain things too ;)

Incidentally, since I got it working once, it hasn't worked since.  Even after a reboot.  I think my machine is just hosed.