INTERACT FORUM

Windows => Plug-in Development => Topic started by: nexusarx on November 03, 2019, 03:50:33 am

Title: C# How to get running instance of MediaCenter
Post by: nexusarx on November 03, 2019, 03:50:33 am
Hi Everyone!

Can anyone help to about the following problem:

I want to create an application that could control the MediaCenter.

I can create a new instance, but it stops my application!
MediaCenter.MCAutomation mc = new MediaCenter.MCAutomation();

How can I get instance of the running MediaCenter ?

Thanks!
Title: Re: C# How to get running instance of MediaCenter
Post by: JimH on November 03, 2019, 04:56:58 am
Take a look at MCWS on this page:
https://wiki.jriver.com/index.php/DevZone
Title: Re: C# How to get running instance of MediaCenter
Post by: nexusarx on November 03, 2019, 05:04:22 am
Thank your answer!

I read a lot of topics and tried lot of code , but it does not work!

I want to use a solution like this :
 System.Type oType = System.Type.GetTypeFromProgID("MediaJukebox Application");
 MediaCenter.MCAutomation mc = (MediaCenter.MCAutomation)Marshal.GetActiveObject("MediaJukebox Application");

But it does not work !!!

Can you give me a working source code ?

Thank you very much,
Karesz


Title: Re: C# How to get running instance of MediaCenter
Post by: JimH on November 03, 2019, 05:19:41 am
On the MCWS page, read how to get the instructions.  Run MC, then enter:
http://localhost:52199/MCWS/v1/doc
Title: Re: C# How to get running instance of MediaCenter
Post by: nexusarx on November 03, 2019, 05:52:10 am
Thank you, but you write a totaly different solution. I know this solution and I can use the WebRequest !

I want to connect to the MediaCenter through the API (MediaCenter.dll or Media Center xx.tbl) and not the MCWS!

Thanks!


 
Title: Re: C# How to get running instance of MediaCenter
Post by: millst on November 03, 2019, 11:47:59 am
Start with the sticky thread and download the C# template solution. It's old, but works. I posted a solution here, too:

https://yabb.jriver.com/interact/index.php/topic,104563.0.html

It probably started from the template, but was upgraded to something more modern (probably VS2015).

-tm
Title: Re: C# How to get running instance of MediaCenter
Post by: nexusarx on November 15, 2019, 03:26:14 am
Thanks millst!

Your source gave me enough help to start my project .
Thank you very much!

- Karesz