Reflection and HREF EXE's
I have a project that's built with multiple EXE's which are deployed from a web server (http://servername/myapp.exe). I needed to create an instance of a winform in one EXE from another EXE. I fiddled with some code and came up with this:
private void showContact(int contactId)
{
Assembly asm = Assembly.LoadFrom( getServerName() +
"/ContactEdit/ContactEdit.exe" );
object o = asm.CreateInstance( "ContactEdit.ContactClient" );
MethodInfo method = o.GetType().GetMethod( "LoadContact" );
method.Invoke(o, new Object[] { contactId } );
((Form)o).Show();
}
I was happy to see that I can remotely load an EXE type assembly.
What was that?...did somebody say IDispatch?...oh...you said "I love that"...cool
(insert blank face emoticon here)

0 Comments:
Post a Comment
<< Home