Click here to Skip to main content
15,915,093 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Time format Pin
Eugen Podsypalnikov8-Sep-10 23:52
Eugen Podsypalnikov8-Sep-10 23:52 
QuestionRe: Time format Pin
David Crow9-Sep-10 4:01
David Crow9-Sep-10 4:01 
QuestionSpliiting a DWORD Pin
Ben Aldhouse8-Sep-10 21:39
Ben Aldhouse8-Sep-10 21:39 
AnswerRe: Spliiting a DWORD Pin
Electron Shepherd8-Sep-10 21:40
Electron Shepherd8-Sep-10 21:40 
GeneralRe: Spliiting a DWORD Pin
Ben Aldhouse8-Sep-10 21:48
Ben Aldhouse8-Sep-10 21:48 
GeneralRe: Spliiting a DWORD Pin
Ben Aldhouse16-Sep-10 21:55
Ben Aldhouse16-Sep-10 21:55 
AnswerRe: Spliiting a DWORD Pin
Ben Aldhouse8-Sep-10 21:45
Ben Aldhouse8-Sep-10 21:45 
GeneralRe: Spliiting a DWORD Pin
Richard MacCutchan8-Sep-10 23:03
mveRichard MacCutchan8-Sep-10 23:03 
Ben Aldhouse wrote:
Still think there may be an easier way of doing this.


Yes, don't go in for complex mathematical expressions, even though the compiler will optimise them. Reread the previous answer and adjust for whichever part is the 8-bit and whichever is the 24-bit. In either case just use simple shifts AND and OR operators thus:
DWORD dwValue = (bits8 << 24) | bits24;
// or
DWORD dwValue = (bits24 << 8) | bits8;

And to split
bits8 = dwValue & 0xFF;
bits24 = dwValue >> 8;
// or
bits24 = dwValue & 0xFFFFFF;
bits8 = dwValue >> 24;

It's time for a new signature.

GeneralRe: Spliiting a DWORD Pin
normanS11-Sep-10 18:17
normanS11-Sep-10 18:17 
GeneralRe: Spliiting a DWORD Pin
Richard MacCutchan11-Sep-10 21:37
mveRichard MacCutchan11-Sep-10 21:37 
GeneralRe: Spliiting a DWORD Pin
Ben Aldhouse16-Sep-10 21:52
Ben Aldhouse16-Sep-10 21:52 
GeneralRe: Spliiting a DWORD Pin
Richard MacCutchan16-Sep-10 22:37
mveRichard MacCutchan16-Sep-10 22:37 
AnswerRe: Spliiting a DWORD PinPopular
Aescleal8-Sep-10 23:24
Aescleal8-Sep-10 23:24 
QuestionCrect pass to CWnd, possible? Pin
loid grey manuel8-Sep-10 17:42
loid grey manuel8-Sep-10 17:42 
AnswerRe: Crect pass to CWnd, possible? Pin
Cool_Dev8-Sep-10 18:26
Cool_Dev8-Sep-10 18:26 
GeneralRe: Crect pass to CWnd, possible? Pin
loid grey manuel8-Sep-10 19:10
loid grey manuel8-Sep-10 19:10 
GeneralRe: Crect pass to CWnd, possible? Pin
Cool_Dev8-Sep-10 19:47
Cool_Dev8-Sep-10 19:47 
GeneralRe: Crect pass to CWnd, possible? Pin
loid grey manuel8-Sep-10 20:45
loid grey manuel8-Sep-10 20:45 
GeneralRe: Crect pass to CWnd, possible? Pin
Cool_Dev8-Sep-10 20:50
Cool_Dev8-Sep-10 20:50 
GeneralRe: Crect pass to CWnd, possible? [RESOLVED] Pin
loid grey manuel8-Sep-10 21:23
loid grey manuel8-Sep-10 21:23 
GeneralRe: Crect pass to CWnd, possible? Pin
Cool_Dev8-Sep-10 21:56
Cool_Dev8-Sep-10 21:56 
GeneralRe: Crect pass to CWnd, possible? Pin
loid grey manuel13-Sep-10 18:00
loid grey manuel13-Sep-10 18:00 
Questionfstream object as either unicode or non-unicode Pin
Danzy838-Sep-10 14:02
Danzy838-Sep-10 14:02 
AnswerRe: fstream object as either unicode or non-unicode Pin
Richard Andrew x648-Sep-10 15:36
professionalRichard Andrew x648-Sep-10 15:36 
GeneralRe: fstream object as either unicode or non-unicode Pin
CPallini8-Sep-10 21:03
mveCPallini8-Sep-10 21:03 

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.