INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: C# How to get running instance of MediaCenter  (Read 3542 times)

nexusarx

  • Member
  • *
  • Posts: 4
C# How to get running instance of MediaCenter
« 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!
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72436
  • Where did I put my teeth?
Re: C# How to get running instance of MediaCenter
« Reply #1 on: November 03, 2019, 04:56:58 am »

Take a look at MCWS on this page:
https://wiki.jriver.com/index.php/DevZone
Logged

nexusarx

  • Member
  • *
  • Posts: 4
Re: C# How to get running instance of MediaCenter
« Reply #2 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


Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72436
  • Where did I put my teeth?
Re: C# How to get running instance of MediaCenter
« Reply #3 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
Logged

nexusarx

  • Member
  • *
  • Posts: 4
Re: C# How to get running instance of MediaCenter
« Reply #4 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!


 
Logged

millst

  • Galactic Citizen
  • ****
  • Posts: 256
Re: C# How to get running instance of MediaCenter
« Reply #5 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
Logged

nexusarx

  • Member
  • *
  • Posts: 4
Re: C# How to get running instance of MediaCenter
« Reply #6 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
Logged
Pages: [1]   Go Up