D
doriengard
Dear VB gurus,
A long question, thanks for your patience in advance
Part 1) I have a VB windows application that contains a start-up form:
frmMain
Inside frmMain, there is a Private variable that is specified as the
top level object of a third party program
Private ThirdPartyProgram as Happ.HappLS ' object reference for third
party program
________
Part 2) I have a Class named aplBlock that needs to contain a reference
to ThirdPartyProgram contained in frmMain. What I have done is created
a constructor that forces a Happ.HappLS value to be passed ByRef to the
class when it is created
Class aplBlock
Private 3rd as Happ.HappLS
Sub New (ByRef ao_Object as Happ.HappLS)
3rd = ao_Object
End Sub
________
Finally to my question
What I want to do is create an instance of aplBlock anywhere in my
application and be able to use properties and methods related to the
variable 3rd.
For example, in a form that is not the frmMain, I want to have the
following code under a command click event
Class frmOther
dim lo_Block as aplBlock
_ClickEvent
lo_Block = new aplBlock(reference to frmMain ThirdPartyProgram)
BogusVariable = lo_Block.Property
The error message I get when the BogusVariable line is executed is that
the Property does not exist. This implies to me that the ByRef passing
into the instance of the aplBlock Class is not functioning as I expect.
I understand that I could set up properties that get me directly back
to the frmMain. However, the Class aplBlock (and other similar stuff)
is being written so it is transportable to different applications. It
is necessary to be able to pass the ThirdPartyProgram reference into
the class so the class is not dependent upon the structure of the
calling application.
I hope this makes sense.
Any advice would be appreciated.
I tried this in VB.NET 2003
I will be upgrading to VB.NET 2005 soon. Advice in either version (if
there is a difference) would be welcome.
Michael Reed
(e-mail address removed)
A long question, thanks for your patience in advance

Part 1) I have a VB windows application that contains a start-up form:
frmMain
Inside frmMain, there is a Private variable that is specified as the
top level object of a third party program
Private ThirdPartyProgram as Happ.HappLS ' object reference for third
party program
________
Part 2) I have a Class named aplBlock that needs to contain a reference
to ThirdPartyProgram contained in frmMain. What I have done is created
a constructor that forces a Happ.HappLS value to be passed ByRef to the
class when it is created
Class aplBlock
Private 3rd as Happ.HappLS
Sub New (ByRef ao_Object as Happ.HappLS)
3rd = ao_Object
End Sub
________
Finally to my question
What I want to do is create an instance of aplBlock anywhere in my
application and be able to use properties and methods related to the
variable 3rd.
For example, in a form that is not the frmMain, I want to have the
following code under a command click event
Class frmOther
dim lo_Block as aplBlock
_ClickEvent
lo_Block = new aplBlock(reference to frmMain ThirdPartyProgram)
BogusVariable = lo_Block.Property
The error message I get when the BogusVariable line is executed is that
the Property does not exist. This implies to me that the ByRef passing
into the instance of the aplBlock Class is not functioning as I expect.
I understand that I could set up properties that get me directly back
to the frmMain. However, the Class aplBlock (and other similar stuff)
is being written so it is transportable to different applications. It
is necessary to be able to pass the ThirdPartyProgram reference into
the class so the class is not dependent upon the structure of the
calling application.
I hope this makes sense.
Any advice would be appreciated.
I tried this in VB.NET 2003
I will be upgrading to VB.NET 2005 soon. Advice in either version (if
there is a difference) would be welcome.
Michael Reed
(e-mail address removed)