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

C / C++ / MFC

 
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 
GeneralRe: Setting Up Option Parameters :: C++ Pin
valikac4-May-02 8:43
valikac4-May-02 8:43 
Thanks.

You, Ravi Bhavnani, and Maxwell Chen posted three very similar techniques. All seems important. Your technique, however, make use of #define instead of enum and DWORD instead of UINT.

1) Can you explain #define over enum and DWORD of UINT?
2) Can I use #define FEATURE1 1, #define FEATURE2 2, etc.. instead of hex?
3) I asked Maxwell Chen about calling the FEATURE1 *outside* of the class.

For example:

-----
int main()
{
...
SetVariableA(FEATURE1);
-----

How does mean know what FEATURE1, FEATURE2, etc. are?

Last, this question applies to everyone. In the function,

// SetVariableA (FEATURE1 | FEATURE3);

I believe that means you want FEATURE1 and you want FEATURE3. However, in the implementation of SetVariableA(UINT) or SetVariableA(DWORD), there are cases for (dwFlags & FEATURE1), (dwFlags & FEATURE2), etc. How about something like:

// FEATURE1 | FEATURE3

Oh. I think I know what is going on. For every "if cases" the statement sets *each* FEATURE accordingly. For example:

// SetVariableA (FEATURE1 | FEATURE3);

// SetVariableA(UINT flags) or SetVariableA(DWORD flags)
{
if (flags & FEATURE1) // applying to the call above, YES
if (flags & FEATURE2) // NO
if (flags & FEATURE3) // YES
}

Am I on track?

Kuphryn
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 
GeneralRe: Adding something to the system menu in the title bar Pin
Stan the man4-May-02 10:49
Stan the man4-May-02 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.