Click here to Skip to main content
15,926,507 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralUsing Events hooks... Pin
TomK25-Feb-01 21:25
TomK25-Feb-01 21:25 
Generalwin2k file protection Pin
25-Feb-01 19:31
suss25-Feb-01 19:31 
GeneralRe: win2k file protection Pin
l a u r e n26-Feb-01 5:58
l a u r e n26-Feb-01 5:58 
GeneralRe: win2k file protection Pin
26-Feb-01 6:43
suss26-Feb-01 6:43 
GeneralRe: win2k file protection Pin
l a u r e n26-Feb-01 10:32
l a u r e n26-Feb-01 10:32 
GeneralRe: win2k file protection Pin
Erik Funkenbusch26-Feb-01 12:37
Erik Funkenbusch26-Feb-01 12:37 
QuestionIs this simplified picture of message pumping correct? Pin
25-Feb-01 5:11
suss25-Feb-01 5:11 
GeneralVisual C++ Bug?! (bitwise operations). Pin
25-Feb-01 0:44
suss25-Feb-01 0:44 
Can anyone explain why this template does not work with signed types? Mad | :mad:

template<class t=""> T IsolateBits(T x, int bit1, int bit2)
{
T v=0;
for(int b=0; b < bit2-bit1; b++)
{
v = (v << 1) | 0x01;
}
for(int b2=0; b2 < bit1; b2++)
{
v = (v << 1);
}
return (x & v);
}

Basically, the template is supposed to change all bits out of range bit1-bit2 to 0's...and it works perfectly unless the class inputed is signed. Any suggestions on how to fix this?

--JesseMad | :mad: Mad | :mad: Blush | :O
GeneralRe: Visual C++ Bug?! (bitwise operations). Pin
Paul Wolfensberger25-Feb-01 4:02
Paul Wolfensberger25-Feb-01 4:02 
Questionhow to put combo box on menu bar Pin
24-Feb-01 15:48
suss24-Feb-01 15:48 
AnswerRe: how to put combo box on menu bar Pin
l a u r e n24-Feb-01 22:55
l a u r e n24-Feb-01 22:55 
GeneralRe: how to put combo box on menu bar Pin
25-Feb-01 10:36
suss25-Feb-01 10:36 
GeneralDynamically resizing a static control Pin
FranzAKlein24-Feb-01 3:01
FranzAKlein24-Feb-01 3:01 
GeneralRe: Dynamically resizing a static control Pin
l a u r e n24-Feb-01 4:07
l a u r e n24-Feb-01 4:07 
GeneralRuler Control Pin
FranzAKlein24-Feb-01 2:35
FranzAKlein24-Feb-01 2:35 
GeneralRe: Ruler Control Pin
l a u r e n24-Feb-01 4:02
l a u r e n24-Feb-01 4:02 
GeneralRe: Ruler Control Pin
26-Feb-01 8:24
suss26-Feb-01 8:24 
GeneralRe: Ruler Control Pin
l a u r e n26-Feb-01 10:41
l a u r e n26-Feb-01 10:41 
GeneralRe: Ruler Control Pin
26-Feb-01 22:56
suss26-Feb-01 22:56 
GeneralRe: Ruler Control Pin
Erik Funkenbusch26-Feb-01 12:43
Erik Funkenbusch26-Feb-01 12:43 
GeneralRe: Ruler Control Pin
26-Feb-01 23:26
suss26-Feb-01 23:26 
GeneralCasting thread functions Pin
Joe Moldovan23-Feb-01 23:53
Joe Moldovan23-Feb-01 23:53 
GeneralRe: Casting thread functions Pin
Tim Deveaux24-Feb-01 3:57
Tim Deveaux24-Feb-01 3:57 
GeneralRe: Casting thread functions Pin
Joe Moldovan24-Feb-01 9:32
Joe Moldovan24-Feb-01 9:32 
GeneralRe: Casting thread functions Pin
aes24-Feb-01 10:49
aes24-Feb-01 10:49 

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.