Click here to Skip to main content
15,891,204 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionconcatenate linked list of characters Pin
Sadaiyappan1-Sep-08 13:27
Sadaiyappan1-Sep-08 13:27 
AnswerRe: concatenate linked list of characters Pin
Robert.C.Cartaino1-Sep-08 14:51
Robert.C.Cartaino1-Sep-08 14:51 
QuestionA Global Keyboard hook problem. Pin
emmmatty11-Sep-08 9:33
emmmatty11-Sep-08 9:33 
AnswerRe: A Global Keyboard hook problem. Pin
Naveen1-Sep-08 15:21
Naveen1-Sep-08 15:21 
GeneralRe: A Global Keyboard hook problem. Pin
emmmatty11-Sep-08 18:49
emmmatty11-Sep-08 18:49 
GeneralRe: A Global Keyboard hook problem. Pin
Naveen1-Sep-08 19:00
Naveen1-Sep-08 19:00 
AnswerRe: A Global Keyboard hook problem. Pin
Rajesh R Subramanian1-Sep-08 20:51
professionalRajesh R Subramanian1-Sep-08 20:51 
Questionrand() always returns 18467...whats going on.. [modified] Pin
montiee1-Sep-08 8:47
montiee1-Sep-08 8:47 
For the life of me I can't work this out.

In the "apps" InitInstance I seed the random number generator by calling srand(time(NULL));

Then in a thread whenever I invoke rand() and print it out via cout it always has the value of 18467. Now rand() is invoked every minute or two so it's not like it's in a tight loop or anything like that. I never call srand again either. Just the once in the apps InitInstance function.

Anyone experienced this problem before? Currently using Visual Studio 2008. I even went so far as to apply SP1 to it just incase something was fixed. Such a simple thing not working is really annoying me.

Just to add if I print out rand() a few times in the apps InitInstance it works as expected. However once I call it from a UI thread it's always the same number.

modified on Monday, September 1, 2008 3:30 PM

AnswerRe: rand() always returns 18467...whats going on.. Pin
Mark Salsbery1-Sep-08 11:20
Mark Salsbery1-Sep-08 11:20 
GeneralRe: rand() always returns 18467...whats going on.. Pin
montiee1-Sep-08 19:23
montiee1-Sep-08 19:23 
QuestionMy application is closing when i hit enter button through keyboard Pin
hariakuthota1-Sep-08 8:12
hariakuthota1-Sep-08 8:12 
AnswerRe: My application is closing when i hit enter button through keyboard Pin
Cedric Moonen1-Sep-08 8:16
Cedric Moonen1-Sep-08 8:16 
AnswerRe: My application is closing when i hit enter button through keyboard Pin
onlyjaypatel1-Sep-08 19:24
onlyjaypatel1-Sep-08 19:24 
Question3D World Pin
MrMcIntyre1-Sep-08 7:34
MrMcIntyre1-Sep-08 7:34 
AnswerRe: 3D World Pin
Cedric Moonen1-Sep-08 7:50
Cedric Moonen1-Sep-08 7:50 
GeneralRe: 3D World Pin
MrMcIntyre1-Sep-08 8:07
MrMcIntyre1-Sep-08 8:07 
GeneralRe: 3D World Pin
Cedric Moonen1-Sep-08 8:14
Cedric Moonen1-Sep-08 8:14 
GeneralRe: 3D World Pin
MrMcIntyre1-Sep-08 9:06
MrMcIntyre1-Sep-08 9:06 
GeneralRe: 3D World Pin
El Corazon1-Sep-08 15:12
El Corazon1-Sep-08 15:12 
GeneralRe: 3D World Pin
MrMcIntyre1-Sep-08 9:26
MrMcIntyre1-Sep-08 9:26 
GeneralRe: 3D World Pin
MrMcIntyre3-Sep-08 6:38
MrMcIntyre3-Sep-08 6:38 
QuestionHBITMAP to picture control Pin
cherrymotion1-Sep-08 6:42
cherrymotion1-Sep-08 6:42 
AnswerRe: HBITMAP to picture control Pin
Ștefan-Mihai MOGA1-Sep-08 8:06
professionalȘtefan-Mihai MOGA1-Sep-08 8:06 
AnswerRe: HBITMAP to picture control Pin
Mark Salsbery1-Sep-08 11:34
Mark Salsbery1-Sep-08 11:34 
GeneralRe: HBITMAP to picture control Pin
cherrymotion1-Sep-08 19:59
cherrymotion1-Sep-08 19:59 

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.