Namespace My ' The following events are availble for MyApplication: ' ' Startup: Raised when the application starts, before the startup form is created. ' Shutdown: Raised after all application forms are closed. This event is not raised if the application terminates abnormally. ' UnhandledException: Raised if the application encounters an unhandled exception. ' StartupNextInstance: Raised when launching a single-instance application and the application is already active. ' NetworkAvailabilityChanged: Raised when the network connection is connected or disconnected. Partial Friend Class MyApplication End Class End NamespaceI changed it to:
Namespace My ' The following events are availble for MyApplication: ' ' Startup: Raised when the application starts, before the startup form is created. ' Shutdown: Raised after all application forms are closed. This event is not raised if the application terminates abnormally. ' UnhandledException: Raised if the application encounters an unhandled exception. ' StartupNextInstance: Raised when launching a single-instance application and the application is already active. ' NetworkAvailabilityChanged: Raised when the network connection is connected or disconnected. Partial Friend Class App Inherits Framework.App End Class End NamespaceBut, when I compile, the Application.Designer.vb always en up with the default code which points to MyApplication. So, when I run the application, I cannot have my own application code to be executed. My application class looks like this:
Imports System.Data.OleDb Imports Microsoft.VisualBasic.ApplicationServices Imports System.Windows.Forms Public Class App Inherits Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase Public Sub New() MyBase.New(Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) MyBase.EnableVisualStyles = True MyBase.ShutdownStyle = ShutdownMode.AfterAllFormsClose MyBase.IsSingleInstance = True MessageBox.Show("Start") End Sub Private Sub App_Startup(ByVal sender As Object, ByVal e As Microsoft.VisualBasic.ApplicationServices.StartupEventArgs) Handles Me.Startup 'Framework.App.oApplication = System.Windows.Forms.Application Framework.App.Initialize() MessageBox.Show("Initialize") End Sub Private Sub App_StartupNextInstance(ByVal sender As Object, _ ByVal e As Microsoft.VisualBasic.ApplicationServices.StartupNextInstanceEventArgs) Handles Me.StartupNextInstance MessageBox.Show("Application is already running...") End Sub End ClassWhat adjustement should I do in order to have it to use my own Framework.App class?