B
binder.christian
Hi!
I have two applications:
* mainapp.exe
* plugin01.exe
I have 2 "friend" variables in mainapp.exe:
Friend gblConn as SqlConnection
Friend gblPath as string
When mainapp.exe starts, gblConn is declared as a new SqlConnection
and connects to the database, gblPath is filled with the current
application path.
If the user clicks "Button1" in Form1 of mainapp.exe, "PluginForm" of
plugin01.exe is loaded by this code:
Dim extAssembly As System.Reflection.Assembly =
System.Reflection.Assembly.LoadFrom("c:\plugin01.exe")
Dim extform As Form =
extAssembly.CreateInstance("plugin01.PluginForm", True)
Form1.AddOwnedForm(extform)
extform.Show()
Everything works fine so far.
The problem is that I want to share the 2 friend-variables in
mainapp.exe with plugin01.exe (so I can use the same connection -
gblConn - for both applications, etc.).
So, how can I pass / share the variables from mainapp.exe to
plugin01.exe?
I have two applications:
* mainapp.exe
* plugin01.exe
I have 2 "friend" variables in mainapp.exe:
Friend gblConn as SqlConnection
Friend gblPath as string
When mainapp.exe starts, gblConn is declared as a new SqlConnection
and connects to the database, gblPath is filled with the current
application path.
If the user clicks "Button1" in Form1 of mainapp.exe, "PluginForm" of
plugin01.exe is loaded by this code:
Dim extAssembly As System.Reflection.Assembly =
System.Reflection.Assembly.LoadFrom("c:\plugin01.exe")
Dim extform As Form =
extAssembly.CreateInstance("plugin01.PluginForm", True)
Form1.AddOwnedForm(extform)
extform.Show()
Everything works fine so far.
The problem is that I want to share the 2 friend-variables in
mainapp.exe with plugin01.exe (so I can use the same connection -
gblConn - for both applications, etc.).
So, how can I pass / share the variables from mainapp.exe to
plugin01.exe?