How do I start this class?

M

Mike Hamilton

Hello!
I have one more question. I just can't get my application started.

In VB6 I was used to say e. g.

Form1_Load
dim mCls as new ...
End sub

However, it doesn't work in my case, and I can't figure out what is wrong.

I have 3 files in my project:

NolverEngineApp.vb
Program.vb
Form1.vb

////////////////////////////////////////////////////
The code of NolverEngineApp.vb is:

Imports System
Imports System.Collections.Generic
Imports System.Text
Imports Engine
Imports Engine.UISystem

Namespace NolverGame

Public Class NolverEngineApp
Inherits EngineApp

Protected Overloads Overrides Function OnCreate() As Boolean
ScreenControlManager.Init()
Return MyBase.OnCreate()
End Function

Protected Overloads Overrides Sub OnRender()
MyBase.OnRender()
ScreenControlManager.Instance.DoRender()
End Sub

End Class

End Namespace

///////////////////////////////////////////////////////////////////////////

And in Program.vb:

Imports System
Imports System.Collections.Generic
Imports System.Windows.Forms
Imports Engine

Namespace NolverGame
NotInheritable Class Program
Private Sub New()
End Sub
''' <summary>
''' The main entry point for the application.
''' </summary>
<STAThread()> _
Private Shared Sub Main()
EngineApp.ResourceDirectory = "Data"
EngineApp.ConfigName = "Configs/Game.config"

EngineApp.Init(New NolverEngineApp())
EngineApp.Instance.WindowTitle = "Game"

EngineConsole.Init()

If EngineApp.Instance.Create() Then
EngineApp.Instance.Run()
End If

EngineApp.Shutdown()
End Sub
End Class
End Namespace

///////////////////////////////////////////////////////
I would like to start with an application framework, so my start object
would be Form1.
In the form's load event I would like to start the class, if possible.
Can somebody tell me how to do it?

Thank you very much!
Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top