Click here to Skip to main content
15,917,610 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: ctrl+alt+del Pin
Scott H. Settlemier27-Jun-02 9:48
Scott H. Settlemier27-Jun-02 9:48 
GeneralCSocket in MFC Console app Pin
Sprudling24-Jun-02 9:02
Sprudling24-Jun-02 9:02 
GeneralRe: CSocket in MFC Console app Pin
Andres Manggini24-Jun-02 9:12
Andres Manggini24-Jun-02 9:12 
GeneralRe: CSocket in MFC Console app Pin
Sprudling24-Jun-02 10:30
Sprudling24-Jun-02 10:30 
GeneralRe: CSocket in MFC Console app Pin
Nish Nishant24-Jun-02 15:16
sitebuilderNish Nishant24-Jun-02 15:16 
GeneralRe: CSocket in MFC Console app Pin
24-Jun-02 17:52
suss24-Jun-02 17:52 
Generalsingle instance Pin
Anthony988724-Jun-02 8:48
Anthony988724-Jun-02 8:48 
GeneralRe: single instance Pin
Andres Manggini24-Jun-02 9:25
Andres Manggini24-Jun-02 9:25 
You can use the class: CMutex

A Mutex it's a kernel object which can be accessed from different process.

Basically on the first run of your application check for a named mutex, if it doesn't exists, create it, if exists exit your program.

Here's a piece of help from MSDN:

"An object of class CMutex represents a "mutex" — a synchronization object that allows one thread mutually exclusive access to a resource. Mutexes are useful when only one thread at a time can be allowed to modify data or some other controlled resource. For example, adding nodes to a linked list is a process that should only be allowed by one thread at a time. By using a CMutex object to control the linked list, only one thread at a time can gain access to the list."


I don't have an example at hand, sorry.


Hope this helps.



Andres Manggini.
Buenos Aires - Argentina.
GeneralRe: single instance Pin
Dean Michaud24-Jun-02 10:09
Dean Michaud24-Jun-02 10:09 
GeneralRe: single instance Pin
PJ Arends24-Jun-02 16:06
professionalPJ Arends24-Jun-02 16:06 
GeneralRe: single instance Pin
25-Jun-02 7:12
suss25-Jun-02 7:12 
GeneralTreeView Control setting checked Pin
Mr. Bill24-Jun-02 8:32
Mr. Bill24-Jun-02 8:32 
GeneralRe: TreeView Control setting checked Pin
Mr. Bill24-Jun-02 9:11
Mr. Bill24-Jun-02 9:11 
GeneralRe: TreeView Control setting checked Pin
Steve L.24-Jun-02 10:01
Steve L.24-Jun-02 10:01 
GeneralRe: TreeView Control setting checked Pin
Anonymous24-Jul-02 23:57
Anonymous24-Jul-02 23:57 
GeneralTaskbar question... Pin
NodeX24-Jun-02 7:40
NodeX24-Jun-02 7:40 
GeneralRe: Taskbar question... Pin
User 665824-Jun-02 7:47
User 665824-Jun-02 7:47 
GeneralRe: Taskbar question... Pin
NodeX24-Jun-02 9:25
NodeX24-Jun-02 9:25 
GeneralDialogbox Pin
Anthony988724-Jun-02 7:36
Anthony988724-Jun-02 7:36 
GeneralRe: Dialogbox Pin
Mazdak24-Jun-02 8:25
Mazdak24-Jun-02 8:25 
GeneralWhy is this not working??? PLEASE HELP!!! Pin
Al_Pennyworth24-Jun-02 7:27
Al_Pennyworth24-Jun-02 7:27 
Questionhow i can print icon Pin
Alexey Kourakolov24-Jun-02 6:21
Alexey Kourakolov24-Jun-02 6:21 
AnswerRe: how i can print icon Pin
Roger Allen24-Jun-02 6:25
Roger Allen24-Jun-02 6:25 
Generalmoving window Pin
Steve L.24-Jun-02 6:18
Steve L.24-Jun-02 6:18 
GeneralRe: moving window Pin
Jeremy Falcon24-Jun-02 6:25
professionalJeremy Falcon24-Jun-02 6:25 

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.