Click here to Skip to main content
16,007,843 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionBitmap pixel? Pin
26-Mar-02 21:38
suss26-Mar-02 21:38 
AnswerRe: Bitmap pixel? Pin
Tomasz Sowinski26-Mar-02 23:12
Tomasz Sowinski26-Mar-02 23:12 
AnswerRe: Bitmap pixel? Pin
Paul M Watt27-Mar-02 4:54
mentorPaul M Watt27-Mar-02 4:54 
AnswerRe: Bitmap pixel? Pin
Chris Losinger27-Mar-02 5:15
professionalChris Losinger27-Mar-02 5:15 
Generalvisualc++6 and win XP Pin
26-Mar-02 20:47
suss26-Mar-02 20:47 
GeneralRe: visualc++6 and win XP Pin
Christian Graus26-Mar-02 21:01
protectorChristian Graus26-Mar-02 21:01 
GeneralRe: visualc++6 and win XP Pin
27-Mar-02 5:34
suss27-Mar-02 5:34 
GeneralRandom!!!!! Pin
hkl26-Mar-02 20:46
hkl26-Mar-02 20:46 
Hi,

I've found this equation in here:

#define Randomize(min, max) ((rand() % (int)(((max) + 1) - (min))) + (min)) //get a random number between min and max

and I realized that the result generated are the same each time, so I've added this before calling the above equation:

srand((UINT)time(NULL));


But then, when I use multithread, (e.g. 2 threads), they call the Randomize function and the one above, and generate the exact same result.

So, my question is:
How can I get two different results when 2 threads are created at the same time??

(By the way, I've also tried Sleep(Randomize(....)) to let them start at different time...)

PLEASE HELP!!! THANKS!!!
GeneralRe: Random!!!!! Pin
Joaquín M López Muñoz26-Mar-02 21:19
Joaquín M López Muñoz26-Mar-02 21:19 
GeneralRe: Random!!!!! THANK YOU!!! Pin
hkl26-Mar-02 21:40
hkl26-Mar-02 21:40 
GeneralSocket Problem... Pin
hkl26-Mar-02 19:14
hkl26-Mar-02 19:14 
GeneralRe: Socket Problem... Pin
Joaquín M López Muñoz26-Mar-02 19:47
Joaquín M López Muñoz26-Mar-02 19:47 
GeneralRe: Socket Problem... Pin
hkl26-Mar-02 20:01
hkl26-Mar-02 20:01 
GeneralRe: Socket Problem... Pin
Joaquín M López Muñoz26-Mar-02 21:15
Joaquín M López Muñoz26-Mar-02 21:15 
GeneralRe: Socket Problem... Pin
hkl26-Mar-02 21:19
hkl26-Mar-02 21:19 
GeneralPlease help!! Create a thread.. Pin
hkl26-Mar-02 18:13
hkl26-Mar-02 18:13 
GeneralRe: Please help!! Create a thread.. Pin
26-Mar-02 19:26
suss26-Mar-02 19:26 
GeneralRe: Please help!! Create a thread.. Pin
hkl26-Mar-02 19:33
hkl26-Mar-02 19:33 
GeneralRe: Please help!! Create a thread.. Pin
Jon Hulatt26-Mar-02 22:26
Jon Hulatt26-Mar-02 22:26 
QuestionMenuBar, how? Pin
MaTrIX2k226-Mar-02 17:31
MaTrIX2k226-Mar-02 17:31 
AnswerRe: MenuBar, how? Pin
Mazdak26-Mar-02 19:26
Mazdak26-Mar-02 19:26 
GeneralReading/Writing LNK files Pin
Lonnie26-Mar-02 16:50
Lonnie26-Mar-02 16:50 
GeneralRe: Reading/Writing LNK files Pin
alex.barylski26-Mar-02 16:59
alex.barylski26-Mar-02 16:59 
GeneralRe: Reading/Writing LNK files Pin
PJ Arends26-Mar-02 18:50
professionalPJ Arends26-Mar-02 18:50 
GeneralCustom toolbar's Pin
alex.barylski26-Mar-02 16:43
alex.barylski26-Mar-02 16:43 

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.