Click here to Skip to main content
15,899,126 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: how to associate a bit map to a spin control button? Pin
Graham Shanks17-Jan-10 6:17
Graham Shanks17-Jan-10 6:17 
QuestionSearching and displaying specific information Pin
gregarion17-Jan-10 3:20
gregarion17-Jan-10 3:20 
AnswerRe: Searching and displaying specific information Pin
loyal ginger17-Jan-10 3:25
loyal ginger17-Jan-10 3:25 
GeneralRe: Searching and displaying specific information Pin
gregarion17-Jan-10 3:31
gregarion17-Jan-10 3:31 
GeneralRe: Searching and displaying specific information Pin
Bram van Kampen17-Jan-10 5:43
Bram van Kampen17-Jan-10 5:43 
GeneralRe: Searching and displaying specific information Pin
gregarion17-Jan-10 17:57
gregarion17-Jan-10 17:57 
AnswerRe: Searching and displaying specific information Pin
Moak17-Jan-10 6:19
Moak17-Jan-10 6:19 
QuestionMy C++ app forks itself! (win32/64) Pin
Måns Thörnqvist16-Jan-10 21:23
Måns Thörnqvist16-Jan-10 21:23 
Yep, you read correcly, my app is spontaneously forking itself - in windows!

I've written a command-line native C++ app with VS2008 to measure temperature data using a Dallas Semiconductors 1-wire hardware and storing the data in a MySQL server. No MFC or .NET stuff. For this I use the Dallas Semiconductors TMEX SDK (link below) and the MySQL C++ connector.

My app is strictly command-line, is run with scheduler once every minute, and exits normally after a second or so. Most of the time, 98% of runs, everything is fine - no error messages, data stored correcly and all that. But sometimes, about once every hour (though not consistently) the app splits in two (or is possibly run twice). I have included some simple logging of key events in the app, storing them in a textfile along with the process IDs, which are indeed different. It LOOKS like the app is simply started twice, almost simultaneously, each process doing it's work correcly and then exiting. The temperature hardware cannot be shared, so one of the processes pauses to let the other one finish, and then carries on itself. Still no error messages, and nothing in windows logs. The temperature data is simply measured and stored twice. I use the simpliest of C++ language, no threading, no registering of windows classes, nothing. I DO use LoadLibrary to import a DLL for hardware access, and GetCurrentProcessID for logging, but no other WINAPI functions I can think of. Other than the ones used by the MySQL C++ Connector, of course.

What about the scheduler then? Well, I've tried both windows scheduler and an old one I made myself back in the days when the built in windows scheduler couldn't do work once every minute. Same result, except that my own scheduler seems to give the error slightly more often, and more erradic. I've tried to run the app using "CMD.EXE /C [myapp.exe] [my_args]" or "myapp.exe [my_args]" directly with the same result.

The behaviour is identical on two servers, a Windows 2008 R2 x64 on dual-core CPU, and a Windows 2003 original x86 on single core x64 CPU. The former runs a 64 bit version of the app (with a 64-bit DLL), and the latter of course a 32-bit version.

Has anyone dealt with anything similar? Where do I need to look? Anyone seriously interested in helping out please mail me for source code.

Best regards
Måns

TMEX SDK: http://files.dalsemi.com/auto_id/softdev/owdocs_400beta2/Docs/1-Wire_SDK_Help.html
AnswerRe: My C++ app forks itself! (win32/64) Pin
CPallini16-Jan-10 22:08
mveCPallini16-Jan-10 22:08 
GeneralRe: My C++ app forks itself! (win32/64) Pin
Måns Thörnqvist16-Jan-10 22:36
Måns Thörnqvist16-Jan-10 22:36 
GeneralRe: My C++ app forks itself! (win32/64) Pin
CPallini16-Jan-10 23:23
mveCPallini16-Jan-10 23:23 
GeneralRe: My C++ app forks itself! (win32/64) Pin
Måns Thörnqvist17-Jan-10 0:23
Måns Thörnqvist17-Jan-10 0:23 
GeneralRe: My C++ app forks itself! (win32/64) Pin
Bram van Kampen17-Jan-10 5:54
Bram van Kampen17-Jan-10 5:54 
AnswerRe: My C++ app forks itself! (win32/64) Pin
Moak17-Jan-10 2:54
Moak17-Jan-10 2:54 
Questionequivalent of atoi and itoa functions in SDK Pin
samira forooghi16-Jan-10 20:41
samira forooghi16-Jan-10 20:41 
AnswerRe: equivalent of atoi and itoa functions in SDK Pin
Richard MacCutchan16-Jan-10 21:47
mveRichard MacCutchan16-Jan-10 21:47 
GeneralRe: equivalent of atoi and itoa functions in SDK Pin
samira forooghi16-Jan-10 22:50
samira forooghi16-Jan-10 22:50 
GeneralRe: equivalent of atoi and itoa functions in SDK Pin
enhzflep17-Jan-10 11:33
enhzflep17-Jan-10 11:33 
GeneralRe: equivalent of atoi and itoa functions in SDK [modified] Pin
samira forooghi18-Jan-10 0:17
samira forooghi18-Jan-10 0:17 
GeneralRe: equivalent of atoi and itoa functions in SDK Pin
Stuart Dootson18-Jan-10 0:37
professionalStuart Dootson18-Jan-10 0:37 
GeneralRe: equivalent of atoi and itoa functions in SDK Pin
samira forooghi18-Jan-10 0:53
samira forooghi18-Jan-10 0:53 
QuestionSending class object on serial port (communication port) Pin
AnayKulkarni16-Jan-10 20:10
AnayKulkarni16-Jan-10 20:10 
AnswerRe: Sending class object on serial port (communication port) Pin
Richard MacCutchan16-Jan-10 21:49
mveRichard MacCutchan16-Jan-10 21:49 
AnswerRe: Sending class object on serial port (communication port) Pin
Cedric Moonen16-Jan-10 21:56
Cedric Moonen16-Jan-10 21:56 
AnswerRe: Sending class object on serial port (communication port) Pin
CPallini16-Jan-10 22:19
mveCPallini16-Jan-10 22:19 

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.