Click here to Skip to main content
15,916,693 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: C++ Problem Need Help Part 2 Pin
Michael P Butler3-Dec-02 22:07
Michael P Butler3-Dec-02 22:07 
GeneralC++ Problem Need Help Part 1 Pin
alishaklas3-Dec-02 18:56
alishaklas3-Dec-02 18:56 
GeneralRe: C++ Problem Need Help Part 1 Pin
Christian Graus3-Dec-02 19:20
protectorChristian Graus3-Dec-02 19:20 
GeneralRe: C++ Problem Need Help Part 1 Pin
Chris Losinger3-Dec-02 19:33
professionalChris Losinger3-Dec-02 19:33 
GeneralRe: C++ Problem Need Help Part 1 Pin
Roger Wright3-Dec-02 19:48
professionalRoger Wright3-Dec-02 19:48 
GeneralRe: C++ Problem Need Help Part 1 Pin
Rand Al'thor4-Dec-02 9:27
Rand Al'thor4-Dec-02 9:27 
GeneralRe: C++ Problem Need Help Part 1 Pin
joshfl4-Dec-02 11:10
joshfl4-Dec-02 11:10 
GeneralArithmetic Error Handling Pin
Roger Wright3-Dec-02 18:35
professionalRoger Wright3-Dec-02 18:35 
Pardon me if this is trivial, but I haven't had to implement this before...

I have a 64-bit value represented by a struct comprised of two DWORDs, a low part and a high part. I want to add an offset to it, and my first thought was to simply add the unsigned long offset to the low part, then check the result; if the result is lower than the original value, then an overflow occurred, and I need to increment the high part to implement the carry. I'm told, however, that C++ doesn't work that way - the result will be undefined. I've tried a couple of dodges, one being to create an accumulator to concatenate the two DWORD values into a single 64-bit value and perform the addition on that entity, but the compiler hasn't a clue what I mean by that, and complains loudly.

What is the proper way to accomplish this addition?

"My child was Inmate of the Month at Mohave County Jail" - Bumper Sticker in Bullhead City, AZ
GeneralRe: Arithmetic Error Handling Pin
Chris Losinger3-Dec-02 18:56
professionalChris Losinger3-Dec-02 18:56 
GeneralRe: Arithmetic Error Handling Pin
Roger Wright3-Dec-02 19:39
professionalRoger Wright3-Dec-02 19:39 
GeneralRe: Arithmetic Error Handling Pin
Jeff J4-Dec-02 8:20
Jeff J4-Dec-02 8:20 
GeneralMFC static vs shared Pin
pranavamhari3-Dec-02 18:07
pranavamhari3-Dec-02 18:07 
GeneralRe: MFC static vs shared Pin
Kannan Kalyanaraman3-Dec-02 18:31
Kannan Kalyanaraman3-Dec-02 18:31 
GeneralRe: MFC static vs shared Pin
Jim A. Johnson3-Dec-02 18:49
Jim A. Johnson3-Dec-02 18:49 
GeneralRe: MFC static vs shared Pin
Anonymous4-Dec-02 2:36
Anonymous4-Dec-02 2:36 
GeneralXp Icons Pin
pranavamhari3-Dec-02 18:03
pranavamhari3-Dec-02 18:03 
GeneralRe: Xp Icons Pin
Kannan Kalyanaraman3-Dec-02 18:34
Kannan Kalyanaraman3-Dec-02 18:34 
GeneralCWnd* in a Splitter View . Pin
Anonymous3-Dec-02 17:25
Anonymous3-Dec-02 17:25 
GeneralRe: CWnd* in a Splitter View . Pin
jhwurmbach3-Dec-02 21:30
jhwurmbach3-Dec-02 21:30 
GeneralProblem from reading Excel Pin
dragonline5253-Dec-02 16:46
dragonline5253-Dec-02 16:46 
GeneralCustom window resize problem... Pin
Neha3-Dec-02 16:06
Neha3-Dec-02 16:06 
GeneralRe: Custom window resize problem... Pin
Maximilien4-Dec-02 3:05
Maximilien4-Dec-02 3:05 
GeneralMultithreaded Single Document Multiple View Architecture Pin
Rand Al'thor3-Dec-02 15:40
Rand Al'thor3-Dec-02 15:40 
GeneralRe: Multithreaded Single Document Multiple View Architecture Pin
Rand Al'thor4-Dec-02 9:23
Rand Al'thor4-Dec-02 9:23 
GeneralMFC Static vs. Shared Library -- resources not found Pin
Wes Jones3-Dec-02 15:23
Wes Jones3-Dec-02 15:23 

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.