How to use MC methods in .Net projects: Difference between revisions

From wiki.jriver.com
Jump to navigation Jump to search
mNo edit summary
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 25: Line 25:


Now add a reference to this assembly in you project:
Now add a reference to this assembly in you project:

Click 'Browse' in the box below ...

[[File:Create_Assembly_from_Type_Library_Add_Reference_Dialog.jpg]]

navigate to your newly created assembly and click 'Open' and 'Add' after the File Selector closed:

[[File:Create_Assembly_from_Type_Library_Add_Reference_Dialog_Browse.jpg]]

Now you should see a reference to "MediaCenter" in your project.

[[File:Create_Assembly_from_Type_Library_Add_Reference_Solution_Explorer.jpg]]

Latest revision as of 15:36, 22 April 2011

In order to be able to use MC functionallity you'll need to create a new assembly from the Type Library file delivered with MCxx.

In Windows go to Start -> All Programms -> Microsoft Visual Studio xxxx -> Visual Studio Tools and select 'Visual Studio Command Prompt (xxxx)'

Create Assembly from Type Library Command Prompt.jpg

A command box should start

Create Assembly from Type Library Command Prompt Box.jpg

Navigate to the 'C:\Program Files (x86)\J River\Media Center xx' Directory. Type the following:

   tlbimp "Media Center xx.tlb"

'xx' = the version of MC (i.e. 14, 15, 16, etc)

If you now look in the directory of MC you navigated to above you'll find the newly generated 'MediaCenter.dll'. This is the assembly you will need to reference in your project.

If and when there are no changes to the methods and GUID's in the Type Library of MC then you're good for all future versions!

If you look with ILSpy (a very nice disassembler for .Net Framework) you can see the declaration that are generated.

Create Assembly from Type Library ILSpy.jpg

Now add a reference to this assembly in you project:

Click 'Browse' in the box below ...

Create Assembly from Type Library Add Reference Dialog.jpg

navigate to your newly created assembly and click 'Open' and 'Add' after the File Selector closed:

Create Assembly from Type Library Add Reference Dialog Browse.jpg

Now you should see a reference to "MediaCenter" in your project.

Create Assembly from Type Library Add Reference Solution Explorer.jpg