J
Jaime Lucci
There is any instruction that replace the App.PrevInstance which is used in
VB6?
Thanks.
VB6?
Thanks.
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
1 Then
m.posseth said:This is the .Net equivalant
If Process.GetProcessesByName
(Process.GetCurrentProcess.ProcessName).Length
Laugh 
m.posseth said:however the alternatives are pretty overdone in my eyes ( carefully
examined them , verry interesting thanks for the links ) especially if
you see the VB6 equivalant , ( big pro for VB6 here )
in my situation my program is called NHSACServer [ Nohau Systems
Aplication Component Server ] i believe this is a pretty strong name
i can`t inmagine that someone would go for a name like that
m.posseth said:yep ,, that is true
however the alternatives are pretty overdone in my eyes ( carefully
examined them , verry interesting thanks for the links ) especially if
you see the VB6 equivalant , ( big pro for VB6 here )
in my situation my program is called NHSACServer [ Nohau Systems
Aplication Component Server ] i believe this is a pretty strong name
i can`t inmagine that someone would go for a name like that
But you are right ,,,, it isn`t completely safe , if someone names his
apllication the same as you did you might have a problem if the user wants
to start them both at the same time and one of the two applications have
the described method implemented , and is the last one to start ( not
the first as this would not interfere )Laugh
As you see i do not believe that it is such a big problem , however it
should be known to annyone who implements it,, as anything that can go
wrong will go wrong at some point and it is good to know were to start
searching in the event it does go wrong .
regards
Michel
m.posseth said:This is the .Net equivalant
If Process.GetProcessesByName (Process.GetCurrentProcess.ProcessName).Length1 Then
here is a usage example ( how i use it in a server component that i created
,,,, actually a bsiness logi remoting host )
<STAThreadAttribute()> _
Public Shared Sub Main()
' refuse to start multiple times on a system
If Process.GetProcessesByName _
(Process.GetCurrentProcess.ProcessName).Length > 1 Then
Dim result As Integer = MessageBox.Show _
("Another Instance of " & Process.GetCurrentProcess.ProcessName & " is
already running ! " & _
vbCrLf & "This is a server component and needs to run only once ", _
vbCrLf & "are you sure you want to start another instance ? ", _
MessageBoxButtons.YesNo, _
MessageBoxIcon.Question)
If result = 7 Then
Application.Exit()
End If
Else
Dim initForm As New frmMain
Application.Run()
End If
End Sub
Met vriendelijke groeten ,
kind regards,
Michel Posseth
Software developer [MCP]
"I have not failed. I've just found 10,000 ways that won't work."
Nohau systems B.V.
Division systems development
`s Gravelandseweg 398 A-C
3195 BK
Schiedam
Netherlands
Tel : + 31 (0) 10 8502812
e-mail : (e-mail address removed)
Jaime Lucci said:There is any instruction that replace the App.PrevInstance which is used
in
VB6?
Thanks.

Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.