<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.mediamonkey.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Subscribing_to_events_in_external_applications</id>
	<title>Subscribing to events in external applications - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.mediamonkey.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Subscribing_to_events_in_external_applications"/>
	<link rel="alternate" type="text/html" href="https://www.mediamonkey.com/wiki/index.php?title=Subscribing_to_events_in_external_applications&amp;action=history"/>
	<updated>2026-05-23T13:50:15Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.4</generator>
	<entry>
		<id>https://www.mediamonkey.com/wiki/index.php?title=Subscribing_to_events_in_external_applications&amp;diff=6595&amp;oldid=prev</id>
		<title>Steegy at 13:39, 25 June 2011</title>
		<link rel="alternate" type="text/html" href="https://www.mediamonkey.com/wiki/index.php?title=Subscribing_to_events_in_external_applications&amp;diff=6595&amp;oldid=prev"/>
		<updated>2011-06-25T13:39:44Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 13:39, 25 June 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Subscribing to events==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Subscribing to events==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Subscribing &lt;/del&gt;to events does not work with external applications&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;, like .NET applications if they make the connection to the MediaMonkey application&lt;/del&gt;. See:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;In MediaMonkey 4.0 and above (see [http://www.ventismedia.com/mantis/view.php?id=7920 bug tracking entry]), external applications can subscribe to MediaMonkey events in the same way as they register to other events.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;https&lt;/del&gt;://www.mediamonkey.com/forum/viewtopic.php?f=19&amp;amp;t=29201&amp;amp;p=291459 Events don&#039;t work with C#]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;https&lt;/del&gt;://www.mediamonkey.com/forum/viewtopic.php?f=19&amp;amp;t=45676&amp;amp;p=297214 Trouble With Handling COM Events]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;In older versions however, subscribing &lt;/ins&gt;to events does not work with external applications. See:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;http&lt;/ins&gt;://www.mediamonkey.com/forum/viewtopic.php?f=19&amp;amp;t=29201&amp;amp;p=291459 Events don&#039;t work with C#]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;http&lt;/ins&gt;://www.mediamonkey.com/forum/viewtopic.php?f=19&amp;amp;t=45676&amp;amp;p=297214 Trouble With Handling COM Events]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;A solution is presented in:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;A solution is presented in:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [http://www.mediamonkey.com/forum/viewtopic.php?f=2&amp;amp;t=14004&amp;amp;hilit=com+events MonkeyToys: VB.NET extension adding MCE remote support]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [http://www.mediamonkey.com/forum/viewtopic.php?f=2&amp;amp;t=14004&amp;amp;hilit=com+events MonkeyToys: VB.NET extension adding MCE remote support]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Steegy</name></author>
	</entry>
	<entry>
		<id>https://www.mediamonkey.com/wiki/index.php?title=Subscribing_to_events_in_external_applications&amp;diff=6454&amp;oldid=prev</id>
		<title>Gramatus at 18:01, 29 May 2011</title>
		<link rel="alternate" type="text/html" href="https://www.mediamonkey.com/wiki/index.php?title=Subscribing_to_events_in_external_applications&amp;diff=6454&amp;oldid=prev"/>
		<updated>2011-05-29T18:01:07Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 18:01, 29 May 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l46&quot;&gt;Line 46:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 46:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/source&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/source&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* When you now start MediaMonkey it will connect to your application and event firing will work.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* When you now start MediaMonkey it will connect to your application and event firing will work.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:.NET]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Gramatus</name></author>
	</entry>
	<entry>
		<id>https://www.mediamonkey.com/wiki/index.php?title=Subscribing_to_events_in_external_applications&amp;diff=6452&amp;oldid=prev</id>
		<title>Gramatus: Created page with &quot;==Subscribing to events== Subscribing to events does not work with external applications, like .NET applications if they make the connection to the MediaMonkey application. See: ...&quot;</title>
		<link rel="alternate" type="text/html" href="https://www.mediamonkey.com/wiki/index.php?title=Subscribing_to_events_in_external_applications&amp;diff=6452&amp;oldid=prev"/>
		<updated>2011-05-29T17:58:53Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;==Subscribing to events== Subscribing to events does not work with external applications, like .NET applications if they make the connection to the MediaMonkey application. See: ...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Subscribing to events==&lt;br /&gt;
Subscribing to events does not work with external applications, like .NET applications if they make the connection to the MediaMonkey application. See:&lt;br /&gt;
* [https://www.mediamonkey.com/forum/viewtopic.php?f=19&amp;amp;t=29201&amp;amp;p=291459 Events don&amp;#039;t work with C#]&lt;br /&gt;
* [https://www.mediamonkey.com/forum/viewtopic.php?f=19&amp;amp;t=45676&amp;amp;p=297214 Trouble With Handling COM Events]&lt;br /&gt;
A solution is presented in:&lt;br /&gt;
* [http://www.mediamonkey.com/forum/viewtopic.php?f=2&amp;amp;t=14004&amp;amp;hilit=com+events MonkeyToys: VB.NET extension adding MCE remote support]&lt;br /&gt;
&lt;br /&gt;
===Walkthrough===&lt;br /&gt;
This solution is based on making your assembly ComVisible, registering it and letting an auto-script in MediaMonkey create your application object.  This can be accomplished by creating a class along the lines under.&lt;br /&gt;
* First build and run your program, then call the RegisterCOM() Method to register your application with COM.&lt;br /&gt;
&amp;#039;&amp;#039;(continued after C#-code)&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
using System.Reflection;&lt;br /&gt;
using System.Runtime.InteropServices;&lt;br /&gt;
using SongsDB;&lt;br /&gt;
&lt;br /&gt;
namespace SomeNamespace {&lt;br /&gt;
  [ComVisible(true)] // this overrides [assembly: ComVisible(false)] (is set by project options dialog) so registry don&amp;#039;t get bloated with unneeded types&lt;br /&gt;
  public class EventTest {&lt;br /&gt;
    public SDBApplication SDB { get; private set; }&lt;br /&gt;
&lt;br /&gt;
    public static void RegisterCOM() {&lt;br /&gt;
      RegistrationServices rs = new RegistrationServices();&lt;br /&gt;
      rs.RegisterAssembly(Assembly.GetExecutingAssembly(),&lt;br /&gt;
        AssemblyRegistrationFlags.SetCodeBase);&lt;br /&gt;
    }&lt;br /&gt;
    public static void UnRegisterCOM() {&lt;br /&gt;
      RegistrationServices rs = new RegistrationServices();&lt;br /&gt;
      rs.UnregisterAssembly(Assembly.GetExecutingAssembly());&lt;br /&gt;
    }&lt;br /&gt;
    public void Init(SDBApplication mm) {&lt;br /&gt;
      this.SDB = mm;&lt;br /&gt;
      this.SDB.set_Objects(Assembly.GetExecutingAssembly().GetName().Name, this);&lt;br /&gt;
      this.SDB.OnPlay += () =&amp;gt; { System.Windows.MessageBox.Show(&amp;quot;OnPlay event fired!&amp;quot;); };&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* Add an autoscript-to mediamonkey (ie. a file in ...\MediaMonkey\Scripts\Auto) named SomeScript.vbs that starts your application and runs the Init function.  It&amp;#039;s contents should be like this:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;vb&amp;quot;&amp;gt;&lt;br /&gt;
Sub OnStartup&lt;br /&gt;
   Set o = CreateObject(&amp;quot;SomeNamespace.EventTest&amp;quot;)&lt;br /&gt;
   o.Init(SDB)&lt;br /&gt;
End Sub&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* When you now start MediaMonkey it will connect to your application and event firing will work.&lt;/div&gt;</summary>
		<author><name>Gramatus</name></author>
	</entry>
</feed>