Click here to Skip to main content
15,924,935 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Drag and Drop tree view items Pin
Tomasz Sowinski2-May-01 1:17
Tomasz Sowinski2-May-01 1:17 
GeneralActivating window Pin
F.Dost1-May-01 9:08
F.Dost1-May-01 9:08 
GeneralRe: Activating window Pin
1-May-01 9:55
suss1-May-01 9:55 
GeneralRe: Activating window Pin
Felix Cho1-May-01 11:35
Felix Cho1-May-01 11:35 
GeneralRe: Try this. Pin
Masaaki Onishi1-May-01 17:32
Masaaki Onishi1-May-01 17:32 
GeneralQuest on Flags... Pin
CMFC6.0VS.NETUser1-May-01 9:06
CMFC6.0VS.NETUser1-May-01 9:06 
GeneralRe: Quest on Flags... Pin
l a u r e n1-May-01 11:27
l a u r e n1-May-01 11:27 
GeneralRe: Quest on Flags... Pin
Michael Dunn1-May-01 16:29
sitebuilderMichael Dunn1-May-01 16:29 
Brandon,

You can't prevent someone from creating a particular value (after all, you don't have physical control over their keyboards Smile | :) ). What you want is an assert in your code that checks the passed-in flags. This will tell the programmer that they have passed you an illegal combo of flags.
void CYourFunction ( DWORD dwFlags )
{
  ASSERT( (dwFlags & FLAG1|FLAG2|FLAG3|FLAG4) == FLAG1|FLAG2|FLAG3|FLAG4 ||
          (dwFlags & FLAG1|FLAG2|FLAG3|FLAG4) == 0 );
 
  // function here...
}

This verifies that all or none of FLAG1-4 were passed.

Use ASSERT in MFC code, ATLASSERT in ATL, and _ASSERTE for plain ol' CRT.

--Mike--
http://home.inreach.com/mdunn/
The Signature, back by popular demand: Buffy. Pajamas.
GeneralRe: Quest on Flags... Pin
CMFC6.0VS.NETUser2-May-01 4:25
CMFC6.0VS.NETUser2-May-01 4:25 
Generalsimilar functions in vc++ for clreol and gotoxy Pin
1-May-01 8:55
suss1-May-01 8:55 
GeneralRe: similar functions in vc++ for clreol and gotoxy Pin
Christian Graus1-May-01 13:06
protectorChristian Graus1-May-01 13:06 
GeneralRe: similar functions in vc++ for clreol and gotoxy Pin
Tomasz Sowinski2-May-01 1:23
Tomasz Sowinski2-May-01 1:23 
GeneralHelp Topics Pin
kk91-May-01 8:46
kk91-May-01 8:46 
GeneralCOleControl and Office 200 Problem under NT4 Pin
Michael A Barnhart1-May-01 6:26
Michael A Barnhart1-May-01 6:26 
Generalw*fstream troubles Pin
Someone20021-May-01 5:43
Someone20021-May-01 5:43 
GeneralSimple Custom Control Question Pin
Mark Jones1-May-01 5:14
Mark Jones1-May-01 5:14 
GeneralRe: Simple Custom Control Question Pin
Michael A Barnhart1-May-01 7:36
Michael A Barnhart1-May-01 7:36 
GeneralRe: Simple Custom Control Question Pin
Mark Jones1-May-01 22:47
Mark Jones1-May-01 22:47 
GeneralRe: Simple Custom Control Question Pin
Tomasz Sowinski2-May-01 0:26
Tomasz Sowinski2-May-01 0:26 
GeneralRe: Simple Custom Control Question Pin
Mark Jones2-May-01 0:48
Mark Jones2-May-01 0:48 
GeneralPrint Preview Pin
1-May-01 4:59
suss1-May-01 4:59 
GeneralRe: Print Preview Pin
5-Jun-01 22:10
suss5-Jun-01 22:10 
GeneralRe: Print Preview Pin
Christian Graus5-Jun-01 22:24
protectorChristian Graus5-Jun-01 22:24 
Generalneed help with drawing and scrolling Pin
F.Dost1-May-01 4:27
F.Dost1-May-01 4:27 
GeneralRe: need help with drawing and scrolling Pin
Chris Losinger1-May-01 5:45
professionalChris Losinger1-May-01 5:45 

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.