954,193 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Single instance

Does anyone know how to do single instance in VB.. Pls help me...

yuni
Newbie Poster
1 post since Jan 2007
Reputation Points: 10
Solved Threads: 0
 

What exactly are you asking? Please describe the problem better.

Dukane
Posting Whiz in Training
295 posts since Oct 2006
Reputation Points: 45
Solved Threads: 29
 

I don't think there is any one specific way to limit a program to a single instance. Some use a registry entry to determine if there is an instance already running, while others use a file or create a system-wide semaphore (see MSDN for CreateSemaphore() win32 api function)

Ancient Dragon
Retired & Loving It
Team Colleague
30,046 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,342
 

> Does anyone know how to do single instance in VB.. Pls help me...

Are you talking about creating class instances in a VB program... ?

~s.o.s~
Failure as a human
Administrator
11,938 posts since Jun 2006
Reputation Points: 3,281
Solved Threads: 733
 

Hi,

Use this Code :
In ur MDIFormLoad Or the StartUp Form Load.

Private Sub MYMDIForm_Load()
    If App.PrevInstance Then
        End
    End If
End Sub
QVeen72
Posting Shark
950 posts since Nov 2006
Reputation Points: 84
Solved Threads: 143
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You