Click here to Skip to main content
15,922,894 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: communication with dll Pin
2000ram13-Feb-05 23:44
2000ram13-Feb-05 23:44 
GeneralRe: communication with dll Pin
ThatsAlok14-Feb-05 1:56
ThatsAlok14-Feb-05 1:56 
Generalneed help Pin
Member 172963413-Feb-05 19:47
Member 172963413-Feb-05 19:47 
GeneralRe: need help Pin
Aamir Butt13-Feb-05 19:55
Aamir Butt13-Feb-05 19:55 
GeneralRe: need help Pin
Member 148449613-Feb-05 23:21
Member 148449613-Feb-05 23:21 
Generalto locate the previous instance of an application Pin
URagavSouth13-Feb-05 19:43
URagavSouth13-Feb-05 19:43 
GeneralRe: to locate the previous instance of an application Pin
Anthony_Yio13-Feb-05 19:54
Anthony_Yio13-Feb-05 19:54 
GeneralRe: to locate the previous instance of an application Pin
Basavaraj P.Umadi13-Feb-05 20:23
Basavaraj P.Umadi13-Feb-05 20:23 
hi,
under the WIN32API we have CreateMutex function...

u can use this function to check whether the appilcation is already running..

by its return values u can re-invoke the existing one...

Public Declare Function CreateMutex Lib "kernel32" Alias "CreateMutexA" (lpMutexAttributes As SECURITY_ATTRIBUTES, ByVal bInitialOwner As Long, ByVal lpName As String) As Long

this is the declaration for that function.(from API text viewer)

u can also find help in MSDN abt this.

http://support.microsoft.com/default.aspx?scid=kb;en-us;258088[^]

use this link...

heres a vb sample....

Option Explicit<br />
Const ERROR_ALREADY_EXISTS = 183<br />
<br />
Public Declare Function CreateMutex Lib "Coredll" Alias "CreateMutexW" _<br />
   (lpMutexAttributes As Long, _<br />
   ByVal bInitialOwner As Long, _<br />
   ByVal lpName As String) As Long<br />
<br />
Public Declare Function GetLastError Lib "Coredll" () As Long<br />
<br />
Private Sub Form_Load()<br />
<br />
 Dim error_code<br />
<br />
 CreateMutex CLng(0), 1, App.Title<br />
 If GetLastError() = ERROR_ALREADY_EXISTS Then<br />
   MsgBox "Already running", vbOKOnly, App.Title<br />
   App.End<br />
 Else 'run the application<br />
   MsgBox "OK to run"<br />
 End If<br />
End Sub



all the best..

- thanks and regards,
Basavaraj P.Umadi
GeneralNAT programming Pin
Kanagu_INDIAN13-Feb-05 19:42
Kanagu_INDIAN13-Feb-05 19:42 
Generallive video directshow streaming! Pin
Member 148449613-Feb-05 19:17
Member 148449613-Feb-05 19:17 
Questionthread's local storage, where is it ? Pin
xcavin13-Feb-05 17:52
xcavin13-Feb-05 17:52 
AnswerRe: thread's local storage, where is it ? Pin
Anthony_Yio13-Feb-05 19:51
Anthony_Yio13-Feb-05 19:51 
AnswerRe: thread's local storage, where is it ? Pin
geo_m13-Feb-05 19:52
geo_m13-Feb-05 19:52 
GeneralPCH error Pin
Ashman13-Feb-05 17:02
Ashman13-Feb-05 17:02 
GeneralCrash after making text box blank. Pin
ELY M.13-Feb-05 16:22
ELY M.13-Feb-05 16:22 
GeneralRe: Crash after making text box blank. Pin
Ashman13-Feb-05 17:05
Ashman13-Feb-05 17:05 
GeneralRe: Crash after making text box blank. Pin
ELY M.13-Feb-05 17:40
ELY M.13-Feb-05 17:40 
GeneralRe: Crash after making text box blank. Pin
Ashman13-Feb-05 18:54
Ashman13-Feb-05 18:54 
GeneralRe: Crash after making text box blank. Pin
David Crow14-Feb-05 3:43
David Crow14-Feb-05 3:43 
Generalswitch statement problem Pin
Member 172911913-Feb-05 13:07
Member 172911913-Feb-05 13:07 
GeneralRe: switch statement problem Pin
Ravi Bhavnani13-Feb-05 14:05
professionalRavi Bhavnani13-Feb-05 14:05 
GeneralRe: switch statement problem Pin
Michael Dunn13-Feb-05 16:00
sitebuilderMichael Dunn13-Feb-05 16:00 
GeneralRe: switch statement problem Pin
namaskaaram13-Feb-05 22:24
namaskaaram13-Feb-05 22:24 
GeneralRe: switch statement problem Pin
Anonymous13-Feb-05 23:00
Anonymous13-Feb-05 23:00 
GeneralRe: switch statement problem Pin
David Crow14-Feb-05 3:48
David Crow14-Feb-05 3:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.