Click here to Skip to main content
15,927,592 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Print Preview Pin
Ravi Bhavnani20-Nov-02 11:11
professionalRavi Bhavnani20-Nov-02 11:11 
General2k/xp resizing difference... Pin
Joan M20-Nov-02 8:54
professionalJoan M20-Nov-02 8:54 
GeneralRe: 2k/xp resizing difference... Pin
Tim Smith20-Nov-02 9:13
Tim Smith20-Nov-02 9:13 
GeneralRe: 2k/xp resizing difference... Pin
James R. Twine20-Nov-02 10:53
James R. Twine20-Nov-02 10:53 
GeneralRe: 2k/xp resizing difference... Pin
Joan M20-Nov-02 19:37
professionalJoan M20-Nov-02 19:37 
GeneralRe: 2k/xp resizing difference... Pin
James R. Twine21-Nov-02 4:26
James R. Twine21-Nov-02 4:26 
Generalextract each byte from an integer varialbe Pin
peter ho20-Nov-02 7:43
peter ho20-Nov-02 7:43 
GeneralRe: extract each byte from an integer varialbe Pin
dabs20-Nov-02 8:01
dabs20-Nov-02 8:01 
There are lots of ways to do this:

<br />
<br />
union ByteToInt<br />
{<br />
 unsigned int i;<br />
 struct bytes<br />
 {<br />
    unsigned char a;<br />
    unsigned char b;<br />
    unsigned char c;<br />
    unsigned char d;<br />
 } bytes;<br />
};<br />
<br />
<br />
ByteToInt b2i;<br />
<br />
b2i.i = 0xFF00FF00;<br />
cout << b2i.bytes.a << endl;<br />
// etc.<br />
<br />


- not syntaxchecked or even compileable Smile | :) but I hope you get the picture.

Another method:

<br />
unsigned int i = 0xFF00FFcc;<br />
<br />
unsigned char b1 = static_cast< unsigned char >( i );<br />
unsigned char b2 = static_cast< unsigned char >( i >> 8 );<br />
unsigned char b3 = static_cast< unsigned char >( i >> 16 );<br />
unsigned char b4 = static_cast< unsigned char >( i >> 24 );<br />
<br />




Wenn ist das Nunstück git und Slotermeyer? Ja! Beierhund das oder die Flipperwaldt gersput!
GeneralRe: extract each byte from an integer varialbe Pin
Paul M Watt20-Nov-02 8:03
mentorPaul M Watt20-Nov-02 8:03 
GeneralRe: extract each byte from an integer varialbe Pin
Rick York20-Nov-02 10:41
mveRick York20-Nov-02 10:41 
GeneralRe: extract each byte from an integer varialbe Pin
James R. Twine21-Nov-02 4:14
James R. Twine21-Nov-02 4:14 
GeneralDBTIMESTAMP help needed! Pin
nlecren20-Nov-02 7:30
nlecren20-Nov-02 7:30 
GeneralRe: DBTIMESTAMP help needed! Pin
Mazdak20-Nov-02 8:36
Mazdak20-Nov-02 8:36 
GeneralRe: DBTIMESTAMP help needed! Pin
James R. Twine21-Nov-02 4:25
James R. Twine21-Nov-02 4:25 
GeneralFinding a CWnd under the mouse ... Pin
Maximilien20-Nov-02 6:54
Maximilien20-Nov-02 6:54 
GeneralRe: Finding a CWnd under the mouse ... Pin
Fazlul Kabir20-Nov-02 7:15
Fazlul Kabir20-Nov-02 7:15 
GeneralRe: Finding a CWnd under the mouse ... Pin
Maximilien20-Nov-02 7:44
Maximilien20-Nov-02 7:44 
GeneralRe: Finding a CWnd under the mouse ... Pin
Fazlul Kabir20-Nov-02 7:54
Fazlul Kabir20-Nov-02 7:54 
GeneralPointer Question Pin
20-Nov-02 6:09
suss20-Nov-02 6:09 
GeneralRe: Pointer Question Pin
Christian Graus20-Nov-02 6:34
protectorChristian Graus20-Nov-02 6:34 
GeneralMDI MFC application: being able to run it windowless Pin
Le centriste20-Nov-02 5:59
Le centriste20-Nov-02 5:59 
GeneralRe: MDI MFC application: being able to run it windowless Pin
User 988520-Nov-02 6:56
User 988520-Nov-02 6:56 
GeneralRe: MDI MFC application: being able to run it windowless Pin
Le centriste20-Nov-02 7:14
Le centriste20-Nov-02 7:14 
GeneralRe: MDI MFC application: being able to run it windowless Pin
User 988520-Nov-02 7:48
User 988520-Nov-02 7:48 
GeneralRe: MDI MFC application: being able to run it windowless Pin
User 988520-Nov-02 8:00
User 988520-Nov-02 8:00 

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.