Click here to Skip to main content
15,921,250 members
Home / Discussions / C#
   

C#

 
GeneralRe: music files Pin
Peter Greenall8-Mar-04 12:07
Peter Greenall8-Mar-04 12:07 
QuestionOutlook and word reference?? Pin
Reinier van de Wetering7-Mar-04 23:37
Reinier van de Wetering7-Mar-04 23:37 
AnswerRe: Outlook and word reference?? Pin
fnm8-Mar-04 3:18
fnm8-Mar-04 3:18 
AnswerRe: Outlook and word reference?? Pin
Heath Stewart8-Mar-04 4:39
protectorHeath Stewart8-Mar-04 4:39 
QuestionHow to fire KeyDown Event while pressing TAB key Pin
esupport7-Mar-04 23:13
esupport7-Mar-04 23:13 
AnswerRe: How to fire KeyDown Event while pressing TAB key Pin
Heath Stewart8-Mar-04 4:34
protectorHeath Stewart8-Mar-04 4:34 
GeneralRe: How to fire KeyDown Event while pressing TAB key Pin
esupport8-Mar-04 16:57
esupport8-Mar-04 16:57 
GeneralCreateInstanceAndUnwrap -- File or Dependency Not Found Pin
Matthew Hazlett7-Mar-04 20:39
Matthew Hazlett7-Mar-04 20:39 
I'm trying to create a plugin for an app I am building. I am trying to utalize CreateInstanceAndUnwrap. Been trying for days now, still with no luck. Heres my code:

Sorry its a little messy Smile | :)

AppDomain remote = AppDomain.CreateDomain("Remote DLL");

IPlugin plugin = (IPlugin) remote.CreateInstanceAndUnwrap(
    PluginManager.strPath + @"\" + pluginList.SelectedItem,
    "IPlugin");

plugin.loadAssembly(PluginManager.strPath + @"\" + pluginList.SelectedItem);


I read some demos of apps sorta like this that use Loader : MarshalByRefObject. But that only gives me a referance to the object not an instance. As you can see I'm trying to place the instence in its own AppDomain so I can unload it later.

Anyone have any suggestions, I'm litteraly pulling my hair out (and its quite painfull Big Grin | :-D )
If you have an example that would be great, what my goal is -- to create the object from the DLL in the other app domain so I can call its functions.

The plugin dll is seralizable.

This is what IPlugin looks like:

public interface IPlugin
{
    string Description {get;}
    string Author      {get;}

    void Initalize();
    void Render();
    void SendData();
    void Dispose();
}


The plugin I created looks like this:

public class Plugin : IPlugin
{
    public string Author        { get { return "Matthew Hazlett";    } }
    public string Description   { get { return "Testing the plugin"; } }

    public void Initalize() {}
    public void Render() {}
    public void SendData() {}
    public void Dispose() {}

    public Plugin() {   }
}


Matthew Hazlett
Windows 2000/2003 MCSE
Never got an MCSD, go figure...
GeneralRe: CreateInstanceAndUnwrap -- File or Dependency Not Found Pin
Nick Parker8-Mar-04 3:13
protectorNick Parker8-Mar-04 3:13 
GeneralRe: CreateInstanceAndUnwrap -- File or Dependency Not Found Pin
Matthew Hazlett8-Mar-04 9:05
Matthew Hazlett8-Mar-04 9:05 
GeneralRe: CreateInstanceAndUnwrap -- File or Dependency Not Found Pin
Matthew Hazlett8-Mar-04 15:06
Matthew Hazlett8-Mar-04 15:06 
GeneralRe: CreateInstanceAndUnwrap -- File or Dependency Not Found Pin
Nick Parker8-Mar-04 17:44
protectorNick Parker8-Mar-04 17:44 
GeneralRe: CreateInstanceAndUnwrap -- File or Dependency Not Found Pin
Matthew Hazlett8-Mar-04 18:45
Matthew Hazlett8-Mar-04 18:45 
GeneralRe: CreateInstanceAndUnwrap -- File or Dependency Not Found Pin
Heath Stewart8-Mar-04 4:28
protectorHeath Stewart8-Mar-04 4:28 
GeneralRe: CreateInstanceAndUnwrap -- File or Dependency Not Found Pin
Matthew Hazlett8-Mar-04 9:07
Matthew Hazlett8-Mar-04 9:07 
GeneralRe: CreateInstanceAndUnwrap -- File or Dependency Not Found Pin
Nick Parker8-Mar-04 9:19
protectorNick Parker8-Mar-04 9:19 
GeneralRe: CreateInstanceAndUnwrap -- File or Dependency Not Found Pin
leppie8-Mar-04 7:14
leppie8-Mar-04 7:14 
GeneralRe: CreateInstanceAndUnwrap -- File or Dependency Not Found Pin
Matthew Hazlett8-Mar-04 9:06
Matthew Hazlett8-Mar-04 9:06 
GeneralRe: CreateInstanceAndUnwrap -- File or Dependency Not Found Pin
Matthew Hazlett8-Mar-04 16:35
Matthew Hazlett8-Mar-04 16:35 
GeneralRe: CreateInstanceAndUnwrap -- File or Dependency Not Found Pin
leppie9-Mar-04 6:20
leppie9-Mar-04 6:20 
Question.NET interfaces - why doesn't this work? Pin
Judah Gabriel Himango7-Mar-04 19:00
sponsorJudah Gabriel Himango7-Mar-04 19:00 
AnswerRe: .NET interfaces - why doesn't this work? Pin
Meysam Mahfouzi8-Mar-04 0:02
Meysam Mahfouzi8-Mar-04 0:02 
GeneralRe: .NET interfaces - why doesn't this work? Pin
Judah Gabriel Himango8-Mar-04 4:32
sponsorJudah Gabriel Himango8-Mar-04 4:32 
AnswerRe: .NET interfaces - why doesn't this work? Pin
Werdna8-Mar-04 4:20
Werdna8-Mar-04 4:20 
AnswerRe: .NET interfaces - why doesn't this work? Pin
Heath Stewart8-Mar-04 4:22
protectorHeath Stewart8-Mar-04 4:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.