Click here to Skip to main content
15,917,795 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Ok new Interger query! Pin
David Crow4-Oct-07 3:45
David Crow4-Oct-07 3:45 
AnswerRe: Ok new Interger query! Pin
DQNOK4-Oct-07 4:17
professionalDQNOK4-Oct-07 4:17 
QuestionIntegers and Char Arrays! Pin
Michael1013-Oct-07 15:47
Michael1013-Oct-07 15:47 
AnswerRe: Integers and Char Arrays! Pin
Naveen3-Oct-07 16:22
Naveen3-Oct-07 16:22 
GeneralRe: Integers and Char Arrays! Pin
Michael1013-Oct-07 17:15
Michael1013-Oct-07 17:15 
AnswerRe: Integers and Char Arrays! Pin
ThatsAlok3-Oct-07 19:01
ThatsAlok3-Oct-07 19:01 
AnswerRe: Integers and Char Arrays! Pin
jhwurmbach3-Oct-07 22:35
jhwurmbach3-Oct-07 22:35 
QuestionDoubles change behavior in CreateThread process, why? Pin
TragicComic3-Oct-07 15:13
TragicComic3-Oct-07 15:13 
Hello,
I'm having a problem with my double precision variables right now, and I'm hoping someone out there will be able to give me a hint as to what's going on. The details are going to be a little sketchy simply because of the size and complexity of the application.

I have a function that tests to see if the double precision code is behaving properly. This function looks something like this.

void TestMath()<br />
{<br />
    double kappa = -2.5316332141755993e-008;<br />
    double cx;<br />
    cx = (double)1.0 / (double)kappa;<br />
<br />
    if (cx != -39500192.000000000){<br />
        BREAK("MATH IS WORKING");<br />
    }<br />
}


When this function is called from the main body of my application, it never hits the break. However, if the function is called from a thread I have spawned using CreateThread(), the break does get hit.

The value for cx should be -39500192.776766039, but it's being set to -39500192.000000000

And if I add the line
double cx2 = 1.0 / -2.5316332141755993e-008;
cx2 always equals -39500192.776766039 regardless of where I'm making the call.

Using the IDE and checking the value for kappa indicates that it's value is correctly being stored.

And again, if the function is called from a spawned thread, cx is evaluated to be
-39500192.776766039



To create the thread, I'm simply calling

handle = CreateThread( NULL, 0,(LPTHREAD_START_ROUTINE)threadProcess, parameter, 0, NULL);<br />


And the function declaration for the thread looks like this.

DWORD WINAPI threadProcess(void *param)



Does anyone have any suggestions as to what could be causing this behavior?

Thanks,
Adam
AnswerRe: Doubles change behavior in CreateThread process, why? Pin
TragicComic3-Oct-07 15:32
TragicComic3-Oct-07 15:32 
GeneralRe: Doubles change behavior in CreateThread process, why? Pin
DQNOK4-Oct-07 4:26
professionalDQNOK4-Oct-07 4:26 
Questionretrieve email password on local host? Pin
Gofur Halmurat3-Oct-07 12:36
Gofur Halmurat3-Oct-07 12:36 
AnswerRe: retrieve email password on local host? Pin
Mark Salsbery3-Oct-07 13:03
Mark Salsbery3-Oct-07 13:03 
AnswerRe: retrieve email password on local host? Pin
Stephen Hewitt3-Oct-07 14:44
Stephen Hewitt3-Oct-07 14:44 
AnswerRe: retrieve email password on local host? Pin
Maximilien3-Oct-07 15:37
Maximilien3-Oct-07 15:37 
QuestionLinking to MFC in a non-MFC dll [modified] Pin
Leslie Sanford3-Oct-07 9:45
Leslie Sanford3-Oct-07 9:45 
AnswerRe: Linking to MFC in a non-MFC dll Pin
Nathan Holt at EMOM3-Oct-07 10:49
Nathan Holt at EMOM3-Oct-07 10:49 
AnswerRe: Linking to MFC in a non-MFC dll Pin
Mark Salsbery3-Oct-07 11:31
Mark Salsbery3-Oct-07 11:31 
GeneralRe: Linking to MFC in a non-MFC dll Pin
Leslie Sanford3-Oct-07 13:59
Leslie Sanford3-Oct-07 13:59 
GeneralRe: Linking to MFC in a non-MFC dll Pin
Mark Salsbery4-Oct-07 5:40
Mark Salsbery4-Oct-07 5:40 
GeneralRe: Linking to MFC in a non-MFC dll Pin
Leslie Sanford4-Oct-07 6:25
Leslie Sanford4-Oct-07 6:25 
GeneralRe: Linking to MFC in a non-MFC dll Pin
Mark Salsbery4-Oct-07 6:43
Mark Salsbery4-Oct-07 6:43 
GeneralRe: Linking to MFC in a non-MFC dll Pin
Leslie Sanford4-Oct-07 6:56
Leslie Sanford4-Oct-07 6:56 
GeneralRe: Linking to MFC in a non-MFC dll Pin
Mark Salsbery4-Oct-07 7:11
Mark Salsbery4-Oct-07 7:11 
GeneralRe: Linking to MFC in a non-MFC dll Pin
Leslie Sanford4-Oct-07 7:48
Leslie Sanford4-Oct-07 7:48 
GeneralRe: Linking to MFC in a non-MFC dll Pin
Mark Salsbery4-Oct-07 7:54
Mark Salsbery4-Oct-07 7:54 

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.