CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 1999
    Location
    US, Florida
    Posts
    817

    Something that will prevent user from loading my program twice

    ok look, if i run my program once, it shows up, but if i run it again it shows up again and again and again, finally i can have 100s of same program running...how do I make it so that if my program had been loaded, user can't load it again, unless he closes the original (1st one)


  2. #2
    Join Date
    May 1999
    Posts
    3,332

    Re: Something that will prevent user from loading my program twice

    if App.PrevInstance then
    end
    end if

    ... ends the current instance if another instance is already running.


  3. #3
    Join Date
    Apr 1999
    Posts
    21

    Re: Something that will prevent user from loading my program twice

    AndyK-

    The App.PrevInstance tells if there is already a copy of the program running.

    Use it like:
    If App.PrevInstance then
    End
    End If

    I am not sure if this works properly on NT.

    Kevin


  4. #4
    Join Date
    Apr 1999
    Posts
    21

    Re: Something that will prevent user from loading my program twice

    AndyK-

    The App.PrevInstance tells if there is already a copy of the program running.

    Use it like:
    If App.PrevInstance then
    End
    End If

    I am not sure if this works properly on NT.

    Kevin


Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured