#define STRICT
What that do?
Or perhaps more importantly, where on MSDN would I look it up?
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
http://msdn.microsoft.com/library/devprods/vs6/visualc/vccore/_core_using_strict_type_checking.htm
quote: Original post by Magmai Kai Holmlor
What that do?
Or perhaps more importantly, where on MSDN would I look it up?
Just out of curiosity here. This isn''t somehow related to Mickey Kawicks''s book is it?
I''m asking because he has a 1-page disclaimer in his book regarding "strict" within the book. Apparently, his word-processing program performed a search-and-replace operation and changed the word "struct" to "strict". Therefore, where-ever he says "strict" he really meant to say "struct."
If this is of no assistance then please disregard this post. Your thread title just reminded me of that problem and I thought that maybe that''s why you were asking.
Regards,
Jumpster
Regards,JumpsterSemper Fi
STRICT does a lot of things, the easiest way to reference it is to ''grep "#ifdef STRICT" *.h'' within your include directory and reference all the header files.
In a nutshell, one impact is that most callback functions have explicit types, instead of being simple FARPROC''s. e.g.
instead of
The other biggy is that HANDLE''s will get declared as structures rather than simple void *''s. The relevant snippet is:
So when
DECLARE_HANDLE(HBRUSH);
appears in source, if STRICT is defined it will emit
instead of
typedef HANDLE HBRUSH;
The former makes casts between different HANDLES illegal.
In a nutshell, one impact is that most callback functions have explicit types, instead of being simple FARPROC''s. e.g.
typedef BOOL (CALLBACK* ENUMRESTYPEPROC)(HMODULE hModule, LPTSTR lpType, LONG lParam);
instead of
typedef FARPROC ENUMRESTYPEPROC;
The other biggy is that HANDLE''s will get declared as structures rather than simple void *''s. The relevant snippet is:
#ifdef STRICTtypedef void *HANDLE;#define DECLARE_HANDLE(name) struct name##__ { int unused; }; typedef struct name##__ *name#elsetypedef PVOID HANDLE;#define DECLARE_HANDLE(name) typedef HANDLE name#endiftypedef HANDLE *PHANDLE;
So when
DECLARE_HANDLE(HBRUSH);
appears in source, if STRICT is defined it will emit
struct HBRUSH__ { int unused; };typedef struct HBRUSH__ * HBRUSH;
instead of
typedef HANDLE HBRUSH;
The former makes casts between different HANDLES illegal.
quote:
his word-processing program performed a search-and-replace operation and changed the word "struct" to "strict"
no, but thats funny
I was having problems getting dx8 code to compile and the two things I found different between my code & code that worked were two defines.
#define STRICT
#define _WIN32_DCOM //this one is required, don''t know exactly why... I couldn''t call CoInitializeEx without it
and I was wondering what STRICT did for me... I think I''ll leave it on, thanks WMiller & SiCrane (though I''m using M$ & don''t have a grep, well find&replace I guess...).
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement