And on top of that, macro''s can not be put into namespaces.
I''ve spent quite some hours messing with a similar problem, they should lock up the people who place #defines for words like that in headers. I mean, if it was win32_FindResource, allright, but they really could expect someone else to use the name FindResource somewhere.
My compiler is rewriting my code!
Well macros are really outdated now with inline functions. I know that the Windows API was back in the good old "C" days, but it never hurts to dream of a sunny tomorrow
quote:Original post by AndyTX
Well macros are really outdated now with inline functions. I know that the Windows API was back in the good old "C" days, but it never hurts to dream of a sunny tomorrow
You have no clue what the defines in windows.h are used for, do you?
If you #define UNICODE, all the Win32 functions will map via macros to SomeFunctionW, otherwise they will map to SomeFunctionA. It''s a fairly clean way to do it...most of the time. This is conditional define magic, not inlining.
I understand that completely - hence my original comment. The second response was to do with MACROS, as stated.
The "unicode" type of thing, while being "typical" to do it that way, can be as easily (and more robustly) done with namespaces and templates etc. in C++, but as was previously discussed, the Windows API was not written with these things in mind (for good or for bad).
The "unicode" type of thing, while being "typical" to do it that way, can be as easily (and more robustly) done with namespaces and templates etc. in C++, but as was previously discussed, the Windows API was not written with these things in mind (for good or for bad).
quote:Original post by targhan
Because there is a #define that does that in windows.h
Most of the functions in windows.h are actually defines, to eithery the A or W version (ANSI or Wide character versions), in order for the UNICODE define to make your app compile as unicode.
Dear God.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement