Where is logical place to create global object that will live throughout session?


Author
Message
AlexSosa
AlexSosa
StrataFrame Beginner (43 reputation)StrataFrame Beginner (43 reputation)StrataFrame Beginner (43 reputation)StrataFrame Beginner (43 reputation)StrataFrame Beginner (43 reputation)StrataFrame Beginner (43 reputation)StrataFrame Beginner (43 reputation)StrataFrame Beginner (43 reputation)StrataFrame Beginner (43 reputation)
Group: Forum Members
Posts: 35, Visits: 138
Hi,

Where would be the logical place to instantiate a global COM object that should live throughout the life of a session.  This object will be used to communicate with a VFP layer and will be accesed from many places in the application.

Thank you,

Alex

StrataFrame Team
S
StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Place it in a Shared (static) variable on a class somewhere.  Then, instantiate it in the InitApplication() method of the AppMain.vb (Program.cs) file and you will be able to access it from anywhere by typing ClassName.GlobalVariableName.
Ben Hayat
Ben Hayat
Advanced StrataFrame User (570 reputation)Advanced StrataFrame User (570 reputation)Advanced StrataFrame User (570 reputation)Advanced StrataFrame User (570 reputation)Advanced StrataFrame User (570 reputation)Advanced StrataFrame User (570 reputation)Advanced StrataFrame User (570 reputation)Advanced StrataFrame User (570 reputation)Advanced StrataFrame User (570 reputation)
Group: Forum Members
Posts: 374, Visits: 1.2K
Ben Chase (06/06/2007)
Place it in a Shared (static) variable on a class somewhere. Then, instantiate it in the InitApplication() method of the AppMain.vb (Program.cs) file and you will be able to access it from anywhere by typing ClassName.GlobalVariableName.




Ben, any chance you could offer a sample please?

..ßen
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search