Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Only one instance of program

Status
Not open for further replies.

WP

Programmer
Nov 30, 1999
463
0
0
CH
Hi

I have a background program that polls MQ Series for messages. I have a problem where the user starts another instance of the program which results in messages being processed twice.

I have found code that grabs the task list but this code assumes you are starting from a VB from (Form1).

Is there a way to check if the program is already in memory ?

Thanks,

WP Bill Paton
william.paton@ubsw.com

Check out
 
It is not clear if you mean that the user starts a second instance of your VB Program, or a second instance of MQ Series.

However. This is the code I have in the MAIN module that starts when my users try to run my VB Executable

Dim SaveTitle As String
On Error GoTo handler
If App.PrevInstance Then
SaveTitle = App.Title
AppActivate SaveTitle
MsgBox ("Cannot Start more than one copy of Application.")
End
End If
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top