By StarkMike - 8/14/2006
I have another DLL that needs to hook into my app before its created/initialized. Notice the bold text below... is this where I would put it?
Public NotInheritable Class AppMain
_
Public Shared Sub Main()
'-- Enable the visual styles
System.Windows.Forms.Application.EnableVisualStyles()
'-- Add the handlers for the application events
AddHandler StrataFrameApplication.ShowGateway, AddressOf ShowGateway
AddHandler StrataFrameApplication.InitializingApplication, AddressOf InitApplication
AddHandler StrataFrameApplication.SetDataSources, AddressOf SetDataSources
AddHandler StrataFrameApplication.UnhandledExceptionFound, AddressOf UnhandledExceptionFound
AddHandler StrataFrameApplication.ShowLoginAndInitializeForm, AddressOf ShowLoginAndInitMainForm
My other code here?
'-- Run the application
StrataFrameApplication.RunApplication()
'-- Forcibly close the application to stop message pumps from looping and preventing the application
' from closing
End
End Sub
P.S. Is that the right terminology? Hooking into the app before it's created?
Thanks
|
By Trent L. Taylor - 8/14/2006
It depends on what you are attempting to accomplish. If you need to show a form before a logon form, then no, you would want to put it higher up. But it you are just wanted to execute code before the application is placed in a "wait" state, then this owuld work. Really the best place to add additional code is the InitApplication or ShowLogonAndInitMainForm methods. But what you have there will work fine.
|
|