Click here to Skip to main content
16,016,501 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Setting Up Option Parameters :: C++ Pin
Maxwell Chen4-May-02 8:14
Maxwell Chen4-May-02 8:14 
GeneralRe: Setting Up Option Parameters :: C++ Pin
valikac4-May-02 8:22
valikac4-May-02 8:22 
GeneralClass scope.... Pin
Maxwell Chen4-May-02 8:28
Maxwell Chen4-May-02 8:28 
GeneralRe: Class scope.... Pin
Ravi Bhavnani4-May-02 9:30
professionalRavi Bhavnani4-May-02 9:30 
GeneralRe: Class scope.... Pin
Maxwell Chen4-May-02 9:37
Maxwell Chen4-May-02 9:37 
GeneralRe: Setting Up Option Parameters :: C++ Pin
Maxwell Chen4-May-02 8:19
Maxwell Chen4-May-02 8:19 
GeneralRe: Setting Up Option Parameters :: C++ Pin
valikac4-May-02 8:24
valikac4-May-02 8:24 
GeneralRe: Setting Up Option Parameters :: C++ Pin
PJ Arends4-May-02 8:31
professionalPJ Arends4-May-02 8:31 
I would not use an enum, but rather just a set of defines for every flag

#define FEATURE1  0x00000001  // bit one
#define FEATURE2  0x00000002  // bit two
#define FEATURE3  0x00000004  // bit three
#define FEATURE4  0x00000008  // bit four
#define FEATURE5  0x00000010  // bit five
.
.
.
This will give you up to 32 flags.

Then, the parameter used to set the flags would be a DWORD
void SetVariableA (DWORD dwflags = 0);


You would call it this way
SetVariableA (FEATURE1 | FEATURE3);


Then, inside SetVariableA() you would check to see which flags have been set by using the bitwise AND ( & ) operator
void SetVariableA (DWORD dwFlags)
{
    if (dwFlags & FEATURE1)
    {
        // FEATURE1 flag set, do what has to be done
    }
    if (dwFlags & FEATURE2)
    {
.
.
.

HTH

---
CPUA 0x5041

Sonork 100.11743 Chicken Little

If a man is standing in the middle of the forest speaking and there is no woman around to hear him...is he still wrong?
GeneralRe: Setting Up Option Parameters :: C++ Pin
valikac4-May-02 8:43
valikac4-May-02 8:43 
GeneralRe: Setting Up Option Parameters :: C++ Pin
PJ Arends4-May-02 9:12
professionalPJ Arends4-May-02 9:12 
GeneralRe: Setting Up Option Parameters :: C++ Pin
Maxwell Chen4-May-02 9:28
Maxwell Chen4-May-02 9:28 
GeneralRe: Thanks Pin
valikac4-May-02 9:30
valikac4-May-02 9:30 
GeneralRe: Thanks Pin
Todd Smith6-May-02 12:49
Todd Smith6-May-02 12:49 
GeneralRe: Hex Pin
valikac4-May-02 9:54
valikac4-May-02 9:54 
GeneralRe: Hex Pin
Maxwell Chen4-May-02 10:04
Maxwell Chen4-May-02 10:04 
GeneralRe: Hex Pin
valikac4-May-02 10:13
valikac4-May-02 10:13 
GeneralRe: Hex Pin
Maxwell Chen4-May-02 10:20
Maxwell Chen4-May-02 10:20 
GeneralRe: Hex Pin
valikac4-May-02 11:50
valikac4-May-02 11:50 
GeneralRe: Hex Pin
PJ Arends9-May-02 20:36
professionalPJ Arends9-May-02 20:36 
GeneralRe: Hex Pin
valikac10-May-02 4:37
valikac10-May-02 4:37 
GeneralRe: Hex Pin
Michael Dunn4-May-02 10:07
sitebuilderMichael Dunn4-May-02 10:07 
GeneralRe: Hex Pin
valikac4-May-02 10:10
valikac4-May-02 10:10 
GeneralAdding something to the system menu in the title bar Pin
Stan the man4-May-02 7:11
Stan the man4-May-02 7:11 
GeneralRe: Adding something to the system menu in the title bar Pin
Ravi Bhavnani4-May-02 7:30
professionalRavi Bhavnani4-May-02 7:30 
GeneralRe: Adding something to the system menu in the title bar Pin
Paul M Watt4-May-02 7:31
mentorPaul M Watt4-May-02 7:31 

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.