Hello,
I am trying to reference an object that already exists,
ie, I have a dll project (dllProj) which contains a simple
form. Then I have a main app and a secondary app which
both have references to dllProj. When I start the
project, the main app starts up. I then invoke the
dllProj from the main app and pass data to a property in
dllProj (PropertyOne) which then displays in a textbox on
dllProj. I can set data to another property in dllProj
(NameProperty) and then I can read NameProperty in the
main app. Then the main app starts up a secondary app
(form). I would like to read the value of NameProperty in
dllProj from the secondary app. I tried the following in
the secondary app but got an error:
Dim frm As dllProj.dllFormClass
Private Sub Form_Load(...)
Dim s As String
s = frm.NameProperty
msgbox s
End Sub
I get the error that the object frm was not set to an
instance of dllProj.dllFormClass. In the main app I say
Dim frm New dllProj.dllFormClass
Dim s As String
s = frm.NamProperty
This works fine except it is a new instance. I would like
to access the existing content of NameProperty contained
in dllProj from the secondary app. So, in addition to
having a reference to dllProj in the secondary app I also
tried
Imports dllProjNamespace
this did not help either. Is there a way I can reference
the already existing instance of dllProj from my secondary
app? Do I need to use something like GetObject?
Thanks,
Rich