Solved

Running an application twice

Posted on 2000-03-05
11
208 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
  • 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
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

856 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