Catching MediaMonkey events in C#. Again.

Post a reply

Smilies
:D :) :( :o :-? 8) :lol: :x :P :oops: :cry: :evil: :roll: :wink:

BBCode is ON
[img] is ON
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Catching MediaMonkey events in C#. Again.

Re: Catching MediaMonkey events in C#. Again.

by Melloware » Wed Jan 13, 2010 1:15 pm

The only way I have seen it solved is in .NET by using a COM object and registering that COM object of your out of process app in MM itself.

See this thread:http://www.mediamonkey.com/forum/viewto ... nts#p69933

You can download and look at the MonkeyToys source code for a working example....

http://www.stax76.bplaced.net/index.php?slab=monkeytoys

Catching MediaMonkey events in C#. Again.

by VolkerK » Tue Jan 12, 2010 6:50 pm

Hello all,

surfed this forum, but only found non-working examples (a lot) or confusing ones, which I cannot use to put my thing to work. I want to write a C# application and catch the events in media monkey, for example by code like this:

Code: Select all

    public partial class frmMain : Window
    {
        public SongsDB.SDBApplication mmapp;

        public frmMain()
        {
            InitializeComponent();

            mmapp = new SongsDB.SDBApplication();
            mmapp.ShutdownAfterDisconnect = false;

            mmapp.OnChangedSelection += new SongsDB.ISDBApplicationEvents_OnChangedSelectionEventHandler(mmapp_OnChangedSelection);
            mmapp.OnPlay += new SongsDB.ISDBApplicationEvents_OnPlayEventHandler(mmapp_OnPlay);
        }

        void mmapp_OnPlay()
        {
                // do something
        }

        void mmapp_OnChangedSelection()
        {
                // do something
        }
It works like this with other COM/ActiveX enabled applications I'm working with (e.g. Skype), but not in MM. What am I doing wrong? And questions to the MediaMonkey developers: what did they do differently that it is so easy in scripting host but so confusing in .NET? Could somebody rewrite me my example in a way which will work? Tested? (Or do I need the Gold version... :-) )

Regards
Volker

Top