Click here to Skip to main content
16,005,339 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionhow to use SetTimer in a Service?(not use windows) Pin
tank102514-Apr-04 5:16
tank102514-Apr-04 5:16 
AnswerRe: how to use SetTimer in a Service?(not use windows) Pin
PJ Arends14-Apr-04 5:48
professionalPJ Arends14-Apr-04 5:48 
AnswerRe: how to use SetTimer in a Service?(not use windows) Pin
David Crow14-Apr-04 5:48
David Crow14-Apr-04 5:48 
QuestionGlobal Locking ? Pin
Mathias S.14-Apr-04 5:00
Mathias S.14-Apr-04 5:00 
AnswerRe: Global Locking ? Pin
Michael Dunn14-Apr-04 5:03
sitebuilderMichael Dunn14-Apr-04 5:03 
GeneralRe: Global Locking ? Pin
John M. Drescher14-Apr-04 7:32
John M. Drescher14-Apr-04 7:32 
AnswerRe: Global Locking ? Pin
Blake Miller14-Apr-04 5:33
Blake Miller14-Apr-04 5:33 
AnswerRe: Global Locking ? Pin
DougW4814-Apr-04 20:33
DougW4814-Apr-04 20:33 
Aside from the mutex, you can open your log file exclusively. I believe the CFile::Open function returns a bool if the file opens, so if your file doesn't open, it means somebody else (another app) is using that file, so just let your app keep trying until it gets access. I wouldn't go trying this on a file where more than a few applications (threads) are going to be using it, but it's a cheap little way of assuring you have exclusive access to your file. However, the code can get a little tricky because you also need to make sure that the file actually exists before you enter a loop that tries to open it exclusively...otherwise your program will go into an infinite loop. The only real benefit of using this method is that you can share your log file on a network, and have your application on multiple computers share it...don't know if you're getting that complex or not (if you are, look into using a database instead.) Good luck
GeneralFlashWindowEx question Pin
Tom Wright14-Apr-04 4:51
Tom Wright14-Apr-04 4:51 
GeneralRe: FlashWindowEx question Pin
Michael Dunn14-Apr-04 5:01
sitebuilderMichael Dunn14-Apr-04 5:01 
GeneralRe: FlashWindowEx question Pin
Tom Wright14-Apr-04 8:01
Tom Wright14-Apr-04 8:01 
GeneralRe: FlashWindowEx question Pin
Michael Dunn14-Apr-04 8:36
sitebuilderMichael Dunn14-Apr-04 8:36 
GeneralRe: FlashWindowEx question Pin
Tom Wright14-Apr-04 9:49
Tom Wright14-Apr-04 9:49 
GeneralRe: FlashWindowEx question Pin
Michael Dunn14-Apr-04 10:50
sitebuilderMichael Dunn14-Apr-04 10:50 
GeneralRe: FlashWindowEx question Pin
Tom Wright14-Apr-04 11:37
Tom Wright14-Apr-04 11:37 
GeneralOutlook crash sometimes (after Automation) Pin
Anonymous14-Apr-04 4:20
Anonymous14-Apr-04 4:20 
GeneralGetting message map for dynamic controls Pin
Nitron14-Apr-04 3:57
Nitron14-Apr-04 3:57 
GeneralRe: Getting message map for dynamic controls Pin
PJ Arends14-Apr-04 5:55
professionalPJ Arends14-Apr-04 5:55 
GeneralRe: Getting message map for dynamic controls Pin
Nitron14-Apr-04 5:57
Nitron14-Apr-04 5:57 
GeneralRe: Getting message map for dynamic controls Pin
PJ Arends14-Apr-04 6:04
professionalPJ Arends14-Apr-04 6:04 
GeneralRe: freeing a char * in Ansi C Pin
Tim Smith14-Apr-04 3:56
Tim Smith14-Apr-04 3:56 
GeneralRe: freeing a char * in Ansi C Pin
John M. Drescher14-Apr-04 4:27
John M. Drescher14-Apr-04 4:27 
GeneralRe: freeing a char * in Ansi C Pin
kfaday14-Apr-04 4:36
kfaday14-Apr-04 4:36 
GeneralRe: freeing a char * in Ansi C Pin
toxcct14-Apr-04 4:18
toxcct14-Apr-04 4:18 
GeneralRe: freeing a char * in Ansi C Pin
Prakash Nadar14-Apr-04 4:42
Prakash Nadar14-Apr-04 4:42 

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.