Click here to Skip to main content
16,007,885 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: initialise another program/software Pin
Duncan Edwards Jones3-Jul-06 4:16
professionalDuncan Edwards Jones3-Jul-06 4:16 
GeneralRe: initialise another program/software Pin
szevy_suez4-Jul-06 7:25
szevy_suez4-Jul-06 7:25 
QuestionDatagrid style Pin
microuser_20003-Jul-06 2:48
microuser_20003-Jul-06 2:48 
QuestionUnloading AppDomain [modified] Pin
matsnas3-Jul-06 1:37
matsnas3-Jul-06 1:37 
AnswerRe: Unloading AppDomain [modified] Pin
Dave Kreskowiak3-Jul-06 7:41
mveDave Kreskowiak3-Jul-06 7:41 
GeneralRe: Unloading AppDomain Pin
matsnas3-Jul-06 8:40
matsnas3-Jul-06 8:40 
GeneralRe: Unloading AppDomain Pin
Dave Kreskowiak3-Jul-06 9:22
mveDave Kreskowiak3-Jul-06 9:22 
GeneralRe: Unloading AppDomain Pin
matsnas3-Jul-06 19:46
matsnas3-Jul-06 19:46 
Thanks, I'll have a go at the examples you posted.

Just one question though, I was expecting to be able to have other programmers write plugins for my application but using AppDomains I would be able to securly shut these plugins down and unload them without disturbing the plugin host?

Note! Written from memory so there might be compilation errors...
namespace AppDomainHost<br />
  public class Host<br />
<br />
    private mAppDomain as AppDomain<br />
    private mIPlugin as AppDomainInterfaces.IPlugin<br />
<br />
    public sub New()<br />
      Dim vEvidence As Evidence = AppDomain.CurrentDomain.Evidence<br />
      mAppDomain = AppDomain.CreateDomain("MyAppDomain", vEvidence)<br />
      mIPlugin = AppDomainInterfaces.Factory.CreateIPlugin(mAppDomain, "AppDomainClient", "AppDomainClient.Client")<br />
      mIPlugin.Connect<br />
      AppDomain.Unload(mAppDomain)<br />
    end sub <br />
<br />
  end class <br />
end namespace <br />
<br />
namespace AppDomainClient<br />
  <serializable()> _<br />
  public class Client<br />
    implements AppDomainInterfaces.IPlugin<br />
<br />
    private mForm as Form<br />
    public sub New()<br />
      mForm = new Form()<br />
    end sub <br />
<br />
    public sub Connect() implements AppDomainInterfaces.IPlugin.Connect<br />
      msgbox("Connected")<br />
    end sub <br />
  end class <br />
end namespace <br />
<br />
namespace AppDomainInterfaces<br />
  public interface IPlugin<br />
    sub Connect()<br />
  end interface<br />
<br />
  public class Factory<br />
    function CreateIPlugin(byval pAppDomain as AppDomain, byval pAssembly as string, byval pType as string)<br />
      dim vIPlugin = directcast(pAppDomain.CreateInstanceAndUnwrap(pAssembly, pType), IPlugin)<br />
      return vIPlugin<br />
    end function <br />
  end class<br />
end namespace

GeneralRe: Unloading AppDomain Pin
Dave Kreskowiak5-Jul-06 1:28
mveDave Kreskowiak5-Jul-06 1:28 
GeneralRe: Unloading AppDomain Pin
matsnas3-Jul-06 20:29
matsnas3-Jul-06 20:29 
QuestionDatetime Pin
vengaqua3-Jul-06 0:01
vengaqua3-Jul-06 0:01 
QuestionPDU format Pin
vengaqua2-Jul-06 23:55
vengaqua2-Jul-06 23:55 
AnswerRe: PDU format Pin
Dave Kreskowiak3-Jul-06 2:57
mveDave Kreskowiak3-Jul-06 2:57 
QuestionSorting Pin
vengaqua2-Jul-06 23:53
vengaqua2-Jul-06 23:53 
AnswerRe: Sorting Pin
Rey99993-Jul-06 2:11
Rey99993-Jul-06 2:11 
QuestionComparing two Objects Pin
alien viper2-Jul-06 23:48
alien viper2-Jul-06 23:48 
AnswerRe: Comparing two Objects Pin
Rey99993-Jul-06 2:08
Rey99993-Jul-06 2:08 
AnswerRe: Comparing two Objects Pin
Dave Kreskowiak3-Jul-06 2:53
mveDave Kreskowiak3-Jul-06 2:53 
Questionif treviewnode's name is blank after rename how to detact Pin
mini87802-Jul-06 23:37
mini87802-Jul-06 23:37 
AnswerRe: if treviewnode's name is blank after rename how to detact Pin
Dave Kreskowiak3-Jul-06 2:50
mveDave Kreskowiak3-Jul-06 2:50 
GeneralRe: if treviewnode's name is blank after rename how to detact Pin
mini87804-Jul-06 1:23
mini87804-Jul-06 1:23 
QuestionGUI Thread Problem Pin
sujanakar2-Jul-06 23:30
sujanakar2-Jul-06 23:30 
AnswerRe: GUI Thread Problem Pin
Dave Kreskowiak3-Jul-06 2:45
mveDave Kreskowiak3-Jul-06 2:45 
Questiondatagridview columns order Pin
Rey99992-Jul-06 23:20
Rey99992-Jul-06 23:20 
AnswerRe: datagridview columns order Pin
Keith Malwitz6-Jul-06 19:08
Keith Malwitz6-Jul-06 19:08 

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.