Results 1 to 8 of 8

Thread: Loading more than 1 copy of the program?

  1. #1

    Thread Starter
    Member King Arthur's Avatar
    Join Date
    Dec 2006
    Location
    UK
    Posts
    36

    Loading more than 1 copy of the program?

    One of my programs runs on networks - some where the .exe sits on the server and others where the .exe is distributed around the network.

    Recently some users (the impatient ones) have managed (by repeated clicking) to load more than one copy of the program onto their work station at the same time. Is there any clever way of stopping this happening without causing problems to those who want to have the .exe just on the server?

    Once into the program I can stop two users using one each other's data - that isn't the problem. It is just the loading.

    Thanks...

  2. #2
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Loading more than 1 copy of the program?

    This is a well-documented topic. What programming language/framework are you using?

  3. #3

    Thread Starter
    Member King Arthur's Avatar
    Join Date
    Dec 2006
    Location
    UK
    Posts
    36

    Re: Loading more than 1 copy of the program?

    I am using VB6. I have obviously been looking at the wrong documents!

  4. #4
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Loading more than 1 copy of the program?

    Thread moved to 'VB6 and Earlier' forum

    A few methods are explained in the article How can I allow only one instance of my application to run at a time? from our Classic VB FAQs (in the FAQ forum, which is shown near the top of our home page)

  5. #5

    Thread Starter
    Member King Arthur's Avatar
    Join Date
    Dec 2006
    Location
    UK
    Posts
    36

    Smile Re: Loading more than 1 copy of the program?

    Thanks a lot. That seems very straightforward. I shall take time to read all the other FAQs so that I won't ask any FAQ again.

    Many thanks

  6. #6

    Thread Starter
    Member King Arthur's Avatar
    Join Date
    Dec 2006
    Location
    UK
    Posts
    36

    Re: Loading more than 1 copy of the program?

    I have tried that code. It is very easy.

    Just one further question. I am sorry if the answer is obvious.

    I fully understand (and have tested) that it works on a stand-alone machine and assume that it works where the .exe is on each workstation.

    However, if a number of workstations are running the program from a single .exe on the server, will they be trapped by this code.

    Thanks

  7. #7
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Loading more than 1 copy of the program?

    No they wont, the checks are only done on the machine that the program is actually running on - it doesn't matter that the program is stored in a shared location.

  8. #8

    Thread Starter
    Member King Arthur's Avatar
    Join Date
    Dec 2006
    Location
    UK
    Posts
    36

    Smile Re: Loading more than 1 copy of the program?

    Thanks for that. I shall get stuck in now and make it happen!

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