Skip to Content
author's profile photo Former Member
Former Member

Keep alive VB.NET application

Hi friends , i've a boring problem.

I would keep alive my application developed with MS Visual Basic.NET ,that works without any windows form.

With a windows form it works very well ,but ,without it(as I want), my application dies and doesn't catch any SBO events.

What should i do?

Thank you very much.

Bye

Giammi

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Nov 25, 2004 at 10:51 AM

    Hello Giammichele,

    if you want to keep your application alive, you can create the following SUb Main

    Public Sub Main()

    Dim m_MyAddOn as MyAddOn

    m_MyAddOn = New MyAddOn(MyParameters)

    System.Windows.Forms.Application.Run()

    End Sub

    MyAddOn would be a class that contains the Application object

    System.Windows.Forms.Application.Run() will keep your application running until you have an Application.Exit

    Sébastien

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 24, 2004 at 12:30 PM

    Hi Giammichele,

    Why dont you just use the form, and put a Me.Hide() in the load event?

    This works for me. Regards,

    Ibai Peñ

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 24, 2004 at 01:14 PM

    Hi,

    yes, it's possible to use Form.Hide 😊)

    Or you can make a cycle in startup object Sub Main() -->

    '*********************************************

    'this is the message loop

    'we use it to catch Events and dispatch them

    'don't forget to terminate the Add On by

    'placing 'End' at the required spot

    '*********************************************

    Do While GetMessage(MessageAPIs.Msg, 0, 0, 0)

    TranslateMessage(MessageAPIs.Msg)

    DispatchMessage(MessageAPIs.Msg)

    System.Windows.Forms.Application.DoEvents()

    Loop

    Good bye

    Tomas

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.