Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic Form in Different Application Domian

Status
Not open for further replies.

mattyboy2000

Programmer
Jul 31, 2002
129
GB
Hi. We've designed our application to dynamically create and call forms using a Different Application domain. We've almost got it working apart from when i want to run a sub that we created ourselves. The reason we are doing this is for the application to first look in the G:\prod\Comp\DLLs folder and if it can't find the DLLs there it will look in G:\eM1\Core\DLLs.

Dim objDomain As AppDomain

Dim objEvidence As Security.Policy.Evidence
Dim strApplicationPath As String

'Create a new domain and run the programs from there
objEvidence = AppDomain.CurrentDomain.Evidence
objDomain = AppDomain.CreateDomain("NewDomain", objEvidence, "G:\", "", False)

objDomain.AppendPrivatePath("prod\Comp\DLLs")
objDomain.AppendPrivatePath("eM1\Core\DLLs")

Dim frmLogin = objDomain.CreateInstanceAndUnwrap("M1Main", "M1Main.frmLogin")

' Hide the system picker and show the login form
Me.Hide()
frmLogin.setdata(Me)

CType(frmLogin, Form).Show()

It all works apart from the Line highlighted in red.

we get the message:

System.MissingMemberException: Public member 'setdata' on type 'MarshalByRefObject' not found.
at Microsoft.VisualBasic.CompilerServices.LateBinding.InternalLateCall(Object o, Type objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack, Boolean IgnoreReturn)
at Microsoft.VisualBasic.CompilerServices.LateBinding.LateCall(Object o, Type objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack)
at SystemPicker.frmMain.ClickedConnectButton(Object sender, EventArgs e) in G:\M1.net\Development\Sourcecode\GlobalM1\SystemPicker\frmMain.vb:line 225


If you have any ideas please reply.

Thanks

Matt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top