Connecting Tech Pros Worldwide Help | Site Map

VB6 and C#

  #1  
Old July 3rd, 2009, 04:46 AM
Member
 
Join Date: Mar 2008
Posts: 72
Expand|Select|Wrap|Line Numbers
  1. If App.PrevInstance = True Then
  2.         MsgBox "The Program is already running. ", vbInformation + vbOKOnly
  3.         Dim frm As Form
  4.         For Each frm In Forms
  5.         Unload frm
  6.         Set frm = Nothing
  7.         Next
  8.         End
  9. else
  10.  
  11. End Sub
i would like to know in c# what is represent the App.PrevInstance (vb6)
  #2  
Old July 3rd, 2009, 06:51 AM
Expert
 
Join Date: Jun 2008
Location: Pretoria, South Africa
Posts: 400
Provided Answers: 2

re: VB6 and C#


Hi

You can use the Mutex class to achieve this.

A few things to remember when using a mutex:
The name you choose must be unique.
You must also release the mutex when exiting the application.

Feel free to post any code that is giving you problems.

Hope this helps.
Reply


Similar Threads
Thread Thread Starter Forum Replies Last Post
VB6 easier than VB.NET? Mitchell S. Honnert answers 66 November 21st, 2005 02:35 PM
Drawing on a .Net device context from a vb6 dll Metallicraft answers 13 November 20th, 2005 06:33 AM
VB.NET COLLECTION VB6 COM Ben Hannon answers 16 November 20th, 2005 05:40 AM