My app. start and exit right away.

  • Thread starter Thread starter Marty
  • Start date Start date
M

Marty

Hi,

I am passing arguments by the command line of my application. I made a
subroutine that check and validate arguments.

'This sub is in a module
public sub main(args as string())
'validate args() content....
'display my main form....
end sub

What happen is that when it reach the end of the main() it exit. Do I
have to place my code in a thread that loop until it get an exit query
from the user?

Thank you!
Marty
 
You need to make sure that you start a message pump. You do this by
calling Application.Run

For example:

Public Sub Main(Args As String())
'Validate args

Dim frm As New MyFormClass
frm.Show

Application.Run()

End Sub

When you are ready to close the app, you would call
Application.ExitThread.
 
right. or call Application.Run(frm), then your app will exit, when you close
frm.
 

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

Back
Top