Results 1 to 5 of 5
  1. #1
    Star Lounger
    Join Date
    Jan 2001
    Posts
    69
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How Does Make Sure Only One Instance of an Applica (VB)

    How Does Make Sure Only One Instance of an Application Runs?

    Hi,

    I have an application and would like to prevent users from opening more than one instance of it; How does one do this? I don't need any code, just the general idea of how to do it;

    Thank you!

    --llyal

  2. #2
    JustCallMeAl
    Guest

    Re: How Does Make Sure Only One Instance of an Applica (VB)

    Okay, since you don't want code....

    You include in the program a line stating that if that application is already running, do not start another instance. This can be accomplished in VB.

  3. #3
    2 Star Lounger
    Join Date
    Aug 2001
    Posts
    158
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How Does Make Sure Only One Instance of an Applica (VB)

    Hi Al:

    Sample code would be a great idea for people like myself <img src=/S/angel.gif border=0 alt=angel width=15 height=21>.

    Thanks
    --Maria

  4. #4
    Star Lounger
    Join Date
    Jan 2001
    Posts
    69
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How Does Make Sure Only One Instance of an Applica (VB)

    I found the solution- one can use the App object in VB to check for a previous instance of the application and then act upon the finding;

    --Llyal

  5. #5
    JustCallMeAl
    Guest

    Re: How Does Make Sure Only One Instance of an Applica (VB)

    You are 100% correct. However, since the original poster stated, "I don't need any code," I didn't provide any code.

    For you, VB6:

    <pre>Private Sub Form_Load()
    If App.PrevInstance Then Exit Sub
    End Sub</pre>


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •