Solved

Running an application twice

Posted on 2000-03-05
11
211 Views
Last Modified: 2010-05-02
Hi,
I would like to know how I can prevent the user from running the EXE file twice.
cause when I do run an EXE twice, I get an error telling me
 "address in use".
0
Comment
Question by:kukiya
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 5
11 Comments
 

Accepted Solution

by:
kfyip earned 10 total points
ID: 2586721
You can use "App.PrevInstance" to check whether an instance of the same application is running.
0
 
LVL 12

Expert Comment

by:roverm
ID: 2586723
use this in your form_load event:

If App.PrevInstance Then
    MsgBox "Already started !!", vbCritical + vbOKOnly, "SOM"
    Unload Me
    End
End If

D'Mzzl!
RoverM
0
 
LVL 12

Expert Comment

by:roverm
ID: 2586728
whoops, you can leave out "SOM" (the title of the msgbox).
kfyip: sorry, had the question open while building the example, didn't see you answer before I posted mine ;-) !

D'Mzzl
RoverM
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:kukiya
ID: 2586743
Adjusted points to 10
0
 

Author Comment

by:kukiya
ID: 2586744
It worked well when I add the "Unload"
thank you very very much!!!!!!
0
 
LVL 12

Expert Comment

by:roverm
ID: 2586967
I know, using it also !
did you see that your q is in the 'waiting to be graded' section twice ?
I wonder if you have graded this one, the other will dissapear too !?

D'Mzzl!
RoverM
0
 

Author Comment

by:kukiya
ID: 2586979
what do you mean by 'waiting to be graded' section twice '?
0
 
LVL 12

Expert Comment

by:roverm
ID: 2587129
Take a look at the section PAQ, your question is appearing twice!
My question: why did you give kfyip the points while you wrote that 'It worked well when I add the "Unload" ', MY CODE!
<TEARS> ;-)

D'Mzzl!
RoverM
0
 

Author Comment

by:kukiya
ID: 2587134
I'm sorry, I not very familier with the points buisness.
of course you should get points.
please tell me how I can reward you now.

now smile!!!!!!
0
 
LVL 12

Expert Comment

by:roverm
ID: 2587225
No need to ! Just kidding! But to 'teach' you:

You can accept any comment as an answer by clicking the command button next to the comment-header.

D'Mzzl!
RoverM <LOL>
0
 

Author Comment

by:kukiya
ID: 2587244
ok thank you very much!!!!!!
I'll use this from now on.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question