Solved

Running an application twice

Posted on 2000-03-05
11
210 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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 

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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

734 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