By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,815 Members | 1,142 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,815 IT Pros & Developers. It's quick & easy.

Reflection Question and MDI question

P: n/a
How can I set the property of a loaded Assembly using reflection. My Shell
program will log in a person and retrieve a list of all programs the person
can use. When the shell program launches a program I use the following
code:

Dim extAssembly As System.Reflection.Assembly =
System.Reflection.Assembly.LoadFrom("D:\testload\T estLoad\TestLoad\bin\Debug\testload.exe")

Dim extForm As Form = extAssembly.CreateInstance("TestLoad.form1", True)

Me.AddOwnedForm(extForm)

extForm.MdiParent = Me

extForm.Show()

(Right now I hard coded the program in loadfrom and the form name in my
program the program name and form name will be retrieved from a dataset).
Each called program will have a class that will contain all the properties I
need to set before it is run (I pass over the userID that logged in, the
UserType like admin or poweruser, and anther piece of infomation regarding
certification.) If my module contains the following code:

Module Login

Private strUserID As String

Private strUserType As String

Private strCertification As String

Public Property UserID() As String

Get

UserID = strUserID

End Get

Set(ByVal value As String)

strUserID = value

End Set

End Property

Public Property UserType() As String

Get

UserType = strUserType

End Get

Set(ByVal value As String)

strUserType = value

End Set

End Property

Public Property Certification() As String

Get

Certification = strCertification

End Get

Set(ByVal value As String)

strCertification = value

End Set

End Property

End Module

how do I set these properties in my loaded programs. This is imperative
that I pass this data so the called program can act like the user logged in
this program.

I want to load these programs in an MDI form. I can do this (as the code
above shows), however, my MDI form needs to have a tree view on the left
that contains a list of all programs they can use. In the right pane I want
to load the program. In addition, I would like an option to hide the
treeview if needed and expand the child window to fill the whole container.
Also, I do not want the user to launch more than one instance of each
program. If they click the program and it is loaded, I just want to show
the loaded child window. How can I create an MDI interface that will dock a
treeview on the left of the form and display the program on the right. I
tried using a split container but cannot find code to load a form into a
split container. How can I detect a loaded child window. Thanks.

John Wright
Apr 3 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
are you looking to load these child Forms I.e as application as executables
?? do you know the source for them or just the executables?

VJ

"John Wright" <ri**********@notmail.com> wrote in message
news:OH**************@TK2MSFTNGP11.phx.gbl...
How can I set the property of a loaded Assembly using reflection. My
Shell program will log in a person and retrieve a list of all programs the
person can use. When the shell program launches a program I use the
following code:

Dim extAssembly As System.Reflection.Assembly =
System.Reflection.Assembly.LoadFrom("D:\testload\T estLoad\TestLoad\bin\Debug\testload.exe")

Dim extForm As Form = extAssembly.CreateInstance("TestLoad.form1", True)

Me.AddOwnedForm(extForm)

extForm.MdiParent = Me

extForm.Show()

(Right now I hard coded the program in loadfrom and the form name in my
program the program name and form name will be retrieved from a dataset).
Each called program will have a class that will contain all the properties
I need to set before it is run (I pass over the userID that logged in, the
UserType like admin or poweruser, and anther piece of infomation regarding
certification.) If my module contains the following code:

Module Login

Private strUserID As String

Private strUserType As String

Private strCertification As String

Public Property UserID() As String

Get

UserID = strUserID

End Get

Set(ByVal value As String)

strUserID = value

End Set

End Property

Public Property UserType() As String

Get

UserType = strUserType

End Get

Set(ByVal value As String)

strUserType = value

End Set

End Property

Public Property Certification() As String

Get

Certification = strCertification

End Get

Set(ByVal value As String)

strCertification = value

End Set

End Property

End Module

how do I set these properties in my loaded programs. This is imperative
that I pass this data so the called program can act like the user logged
in this program.

I want to load these programs in an MDI form. I can do this (as the code
above shows), however, my MDI form needs to have a tree view on the left
that contains a list of all programs they can use. In the right pane I
want to load the program. In addition, I would like an option to hide the
treeview if needed and expand the child window to fill the whole
container. Also, I do not want the user to launch more than one instance
of each program. If they click the program and it is loaded, I just want
to show the loaded child window. How can I create an MDI interface that
will dock a treeview on the left of the form and display the program on
the right. I tried using a split container but cannot find code to load a
form into a split container. How can I detect a loaded child window.
Thanks.

John Wright

Apr 3 '06 #2

P: n/a
These are executables and I know the source. We will be creating all the exe
files from a base form. All programs will have the same Module with the
same three variables as well.

John
"Vijay" <vi***@msdiscussions.com> wrote in message
news:e8**************@TK2MSFTNGP14.phx.gbl...
are you looking to load these child Forms I.e as application as
executables ?? do you know the source for them or just the executables?

VJ

"John Wright" <ri**********@notmail.com> wrote in message
news:OH**************@TK2MSFTNGP11.phx.gbl...
How can I set the property of a loaded Assembly using reflection. My
Shell program will log in a person and retrieve a list of all programs
the person can use. When the shell program launches a program I use the
following code:

Dim extAssembly As System.Reflection.Assembly =
System.Reflection.Assembly.LoadFrom("D:\testload\T estLoad\TestLoad\bin\Debug\testload.exe")

Dim extForm As Form = extAssembly.CreateInstance("TestLoad.form1", True)

Me.AddOwnedForm(extForm)

extForm.MdiParent = Me

extForm.Show()

(Right now I hard coded the program in loadfrom and the form name in my
program the program name and form name will be retrieved from a dataset).
Each called program will have a class that will contain all the
properties I need to set before it is run (I pass over the userID that
logged in, the UserType like admin or poweruser, and anther piece of
infomation regarding certification.) If my module contains the following
code:

Module Login

Private strUserID As String

Private strUserType As String

Private strCertification As String

Public Property UserID() As String

Get

UserID = strUserID

End Get

Set(ByVal value As String)

strUserID = value

End Set

End Property

Public Property UserType() As String

Get

UserType = strUserType

End Get

Set(ByVal value As String)

strUserType = value

End Set

End Property

Public Property Certification() As String

Get

Certification = strCertification

End Get

Set(ByVal value As String)

strCertification = value

End Set

End Property

End Module

how do I set these properties in my loaded programs. This is imperative
that I pass this data so the called program can act like the user logged
in this program.

I want to load these programs in an MDI form. I can do this (as the code
above shows), however, my MDI form needs to have a tree view on the left
that contains a list of all programs they can use. In the right pane I
want to load the program. In addition, I would like an option to hide
the treeview if needed and expand the child window to fill the whole
container. Also, I do not want the user to launch more than one instance
of each program. If they click the program and it is loaded, I just want
to show the loaded child window. How can I create an MDI interface that
will dock a treeview on the left of the form and display the program on
the right. I tried using a split container but cannot find code to load
a form into a split container. How can I detect a loaded child window.
Thanks.

John Wright


Apr 4 '06 #3

P: n/a
Ok that given why are you compiling them as executables.. you can just make
them binaries.. and call the constructor to load each Form...., so would not
have to worry about all this assembly thing, also will make it easier to set
properties... Sorry did I missed something here?

VJ

"John Wright" <ri**********@notmail.com> wrote in message
news:eN**************@TK2MSFTNGP14.phx.gbl...
These are executables and I know the source. We will be creating all the
exe files from a base form. All programs will have the same Module with
the same three variables as well.

John
"Vijay" <vi***@msdiscussions.com> wrote in message
news:e8**************@TK2MSFTNGP14.phx.gbl...
are you looking to load these child Forms I.e as application as
executables ?? do you know the source for them or just the executables?

VJ

"John Wright" <ri**********@notmail.com> wrote in message
news:OH**************@TK2MSFTNGP11.phx.gbl...
How can I set the property of a loaded Assembly using reflection. My
Shell program will log in a person and retrieve a list of all programs
the person can use. When the shell program launches a program I use the
following code:

Dim extAssembly As System.Reflection.Assembly =
System.Reflection.Assembly.LoadFrom("D:\testload\T estLoad\TestLoad\bin\Debug\testload.exe")

Dim extForm As Form = extAssembly.CreateInstance("TestLoad.form1", True)

Me.AddOwnedForm(extForm)

extForm.MdiParent = Me

extForm.Show()

(Right now I hard coded the program in loadfrom and the form name in my
program the program name and form name will be retrieved from a
dataset). Each called program will have a class that will contain all
the properties I need to set before it is run (I pass over the userID
that logged in, the UserType like admin or poweruser, and anther piece
of infomation regarding certification.) If my module contains the
following code:

Module Login

Private strUserID As String

Private strUserType As String

Private strCertification As String

Public Property UserID() As String

Get

UserID = strUserID

End Get

Set(ByVal value As String)

strUserID = value

End Set

End Property

Public Property UserType() As String

Get

UserType = strUserType

End Get

Set(ByVal value As String)

strUserType = value

End Set

End Property

Public Property Certification() As String

Get

Certification = strCertification

End Get

Set(ByVal value As String)

strCertification = value

End Set

End Property

End Module

how do I set these properties in my loaded programs. This is imperative
that I pass this data so the called program can act like the user logged
in this program.

I want to load these programs in an MDI form. I can do this (as the
code above shows), however, my MDI form needs to have a tree view on the
left that contains a list of all programs they can use. In the right
pane I want to load the program. In addition, I would like an option to
hide the treeview if needed and expand the child window to fill the
whole container. Also, I do not want the user to launch more than one
instance of each program. If they click the program and it is loaded, I
just want to show the loaded child window. How can I create an MDI
interface that will dock a treeview on the left of the form and display
the program on the right. I tried using a split container but cannot
find code to load a form into a split container. How can I detect a
loaded child window. Thanks.

John Wright



Apr 5 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.