Click here to Skip to main content
15,923,273 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
GeneralRe: Setting Up Option Parameters :: C++ Pin
PJ Arends4-May-02 9:12
professionalPJ Arends4-May-02 9:12 
kuphryn wrote:
1) Can you explain #define over enum and DWORD of UINT?
with an enum, you can loop over the values, so technically it probably better, but I prefer #defines, They are easier IMO

On 32 bit systems, there is no difference between UINT and DWORD. On 16 bit systems UINT is 16 bits, DWORD is 32 bits

kuphryn wrote:
2) Can I use #define FEATURE1 1, #define FEATURE2 2, etc.. instead of hex?

Yes you can, but remember that you are setting the individual bits, so your values would be 1, 2, 4, 8, 16, 32, 64, 128 etc. using hex is just easier IMO.
just remember that the bitwise OR operator, when used with properly defined flags, acts as a plus operator.
ie :
1 | 2 == 3
1 | 4 == 5
2 | 4 == 6
1 | 2 | 4 == 7
...

kuphryn wrote:
How does mean know what FEATURE1, FEATURE2, etc. are

that is why I put the defines in the header file. Just include the header file in which ever file you use the flags.

kuphryn wrote:
Am I on track?
Yes. Be sure to read up on bitwise operators in MSDN.

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
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 
Questionhow can I print text onto an existing pdf file? Pin
DanYELL4-May-02 7:06
DanYELL4-May-02 7:06 

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.