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
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] 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
}[/code]
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