Click here to Skip to main content
16,013,918 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Exception when assigning char * to CString Pin
Member 75496027-Mar-08 10:09
Member 75496027-Mar-08 10:09 
GeneralRe: Exception when assigning char * to CString [modified] Pin
habs27-Mar-08 11:05
habs27-Mar-08 11:05 
GeneralCopying the contents of a struct from a pointer Pin
KellyR26-Mar-08 8:37
KellyR26-Mar-08 8:37 
AnswerRe: Copying the contents of a struct from a pointer Pin
KellyR26-Mar-08 9:08
KellyR26-Mar-08 9:08 
GeneralRe: Copying the contents of a struct from a pointer Pin
David Crow26-Mar-08 10:00
David Crow26-Mar-08 10:00 
QuestionIs "process" running? Pin
Joseph Marzbani26-Mar-08 8:18
Joseph Marzbani26-Mar-08 8:18 
GeneralRe: Is "process" running? Pin
led mike26-Mar-08 9:50
led mike26-Mar-08 9:50 
AnswerRe: Is "process" running? Pin
Bram van Kampen26-Mar-08 14:48
Bram van Kampen26-Mar-08 14:48 
Well, who wants to know. Another Process? The Same Process, Why?

Version 1.

I did something years ago like this as follows. It assumes that the name of the Exe was not changed, and that we know where it lives. First try to get the File Attributes. If that works, you know the file exists, and that it still lives were you expected it. Now try to change the Name (to it's own Name). This will fail if it's in use. An exe is typically in use when it's running. (Also ofcourse if someone just opened it in a Binary Editor, but most end users don't have those things anyways).
That's simple, but hardly robust.

Version 2.

As soon as your process starts, create a Globaly Named Object (Mutex, Semaphore) but do not claim exclusive ownership, unless if you want to ensure that only one copy runs at anyone time. To determine later whether the process is running, try to create the same Globaly Named Object, but now with exclusive access. This will fail if the object already exists ( i.e. the process is running).

Version 3.

Read Matt Pietrecks dissertations, and spelunk into the inner workings of the Kernel.

Bram van Kampen

Questionimporting DLL file to VC++ 6.0 Pin
MiCRo_26-Mar-08 7:00
MiCRo_26-Mar-08 7:00 
AnswerRe: importing DLL file to VC++ 6.0 Pin
Joseph Marzbani26-Mar-08 8:29
Joseph Marzbani26-Mar-08 8:29 
GeneralRe: importing DLL file to VC++ 6.0 Pin
SandipG 26-Mar-08 11:15
SandipG 26-Mar-08 11:15 
QuestionHow can I change alignment in an edit box in run time? Pin
Joseph Marzbani26-Mar-08 6:55
Joseph Marzbani26-Mar-08 6:55 
GeneralRe: How can I change alignment in an edit box in run time? Pin
led mike26-Mar-08 7:44
led mike26-Mar-08 7:44 
GeneralRe: How can I change alignment in an edit box in run time? Pin
David Crow26-Mar-08 7:50
David Crow26-Mar-08 7:50 
GeneralRe: How can I change alignment in an edit box in run time? Pin
led mike26-Mar-08 8:02
led mike26-Mar-08 8:02 
QuestionHow to store/load several files together when serialize? Pin
followait26-Mar-08 5:43
followait26-Mar-08 5:43 
AnswerRe: How to store/load several files together when serialize? Pin
Iain Clarke, Warrior Programmer26-Mar-08 6:01
Iain Clarke, Warrior Programmer26-Mar-08 6:01 
AnswerRe: How to store/load several files together when serialize? Pin
CPallini26-Mar-08 6:36
mveCPallini26-Mar-08 6:36 
GeneralStrange error using Case statement Pin
piul26-Mar-08 5:14
piul26-Mar-08 5:14 
GeneralRe: Strange error using Case statement Pin
CPallini26-Mar-08 5:32
mveCPallini26-Mar-08 5:32 
GeneralRe: Strange error using Case statement Pin
piul26-Mar-08 5:41
piul26-Mar-08 5:41 
GeneralRe: Strange error using Case statement Pin
rp_suman26-Mar-08 5:49
rp_suman26-Mar-08 5:49 
GeneralRe: Strange error using Case statement Pin
rp_suman26-Mar-08 5:35
rp_suman26-Mar-08 5:35 
Generaldelete zero out its operand Pin
George_George26-Mar-08 5:09
George_George26-Mar-08 5:09 
GeneralRe: delete zero out its operand Pin
CPallini26-Mar-08 5:24
mveCPallini26-Mar-08 5:24 

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.