Thanks Peter,

I'm not referencing the type directly, I'm referencing it as the base
class rather than an interface - surely that should work?

Code snippet:

public partial class MessagingSvc: ServiceBase
{
  private PluginManager _pluginMgr;
  private RemoteListener _remoteListener;

  protected override void OnStart(string[] args)
  {
    _pluginMgr = new PluginManager();
    //  Types are now loaded in

    //  This works (MessageSender is the base class):
    MessageSender obj = (MessageSender)_pluginMgr.CreateInstance
("dbGrid.Plugins.TestPlugins.Test1");
    obj.IsRunning = false;

    //  RemoteListener regsiters the channel for remote commands and
raises events
    _remoteListener = new RemoteListener();
    RemoteListener.StartCommandReceived += new
SenderCommandReceivedEventHandler(CmdListener_StartCommandReceived);
    _remoteListener.StartListen();

  }

  private void CmdListener_StartCommandReceived()
  {
    //  This is executed when the remote 'Start' command is received
    //  Fails with issues described previously
    MessageSender obj = (MessageSender)_pluginMgr.CreateInstance
("dbGrid.Plugins.TestPlugins.Test1");
    obj.IsRunning = false;
  }

}

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to