Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

#define STRICT

47 views
Skip to first unread message

G Chen

unread,
Mar 4, 1999, 3:00:00 AM3/4/99
to
I have EXE DCOM program developed with VC5.0. When recompile it under
VC6.0, I got a warning message said " STRICT micro redefinition.
....windef.h:see previous definition. "
What is this #define STRICT about? Will this warning cause any problem?
Thanks!

Doncho Angelov

unread,
Mar 4, 1999, 3:00:00 AM3/4/99
to
_STRICT (or STRICT, I'm not really sure) macro is used to instruct the
compiler how to generate all the windows' types such as HWND, HANDLE, etc.

If the STRICT macro is not defined, the types such HWND, HANDLE, etc. are
defined as void * (or so on), which allows easy mixup of HWND and HANDLE
(useful if you compile an old (very old) style program). If you do not have
STRICT defined, the following could compile:

HWND a;
HANDLE b;

a=b;

As you can imagine, the above is not correct, thou assigning a HANDLE
(general) to HWND is a little strange operation (and could cause serious
problem(s) and lots of headache).

If you have the STRICT defined, the compiler generates some empty
structures, like
__tagHWND { }, and makes the HWND type to look like __tagHWND * (for
example - you can take more detailed look at the .H files for more
detailes).

In general, the warning could not cause any serious problem (in this
particular case). But warnings like that mean that you have #define
re-#defined, which could case serious program malfunction (for example, if
somewhere you redefine an old #define with different value).

But in this case I think you do not have on what to worry about (maybe for
your confidence it's not a bad idea to find where you have STRICT already
#define-d). You can search either in the .H files, either in Project
Settings to see how many times you #define STRICT.

DonAngel

G Chen wrote in message ...

kbc...@my-dejanews.com

unread,
Mar 4, 1999, 3:00:00 AM3/4/99
to new...@kbcafe.com
No, redefining the STRICT macro is not a problem.

More...
STRICT type checking in WINDOWS.H enhances type safety for Windows programs by
using distinct types to represent all the different HANDLES in Windows. So for
example, STRICT prevents you from mistakenly passing an HPEN to a routine
expecting an HBITMAP.

Randy Charles Morin
Webmaster of KBCafe http://tips.kbcafe.com/tips/
Co-Author of The Waite Group's COM/DCOM Primer Plus
http://www.amazon.com/exec/obidos/ASIN/0672314924/kbcafe
Coming soon: COM/DCOM Unleashed
http://www.amazon.com/exec/obidos/ASIN/0672313529/kbcafe

In article <OAwMf2kZ#GA....@uppssnewspub04.moswest.msn.net>,


"G Chen" <gar...@unidial.com> wrote:
> I have EXE DCOM program developed with VC5.0. When recompile it under
> VC6.0, I got a warning message said " STRICT micro redefinition.
> ....windef.h:see previous definition. "
> What is this #define STRICT about? Will this warning cause any problem?
> Thanks!
>
>

////////////////////////////////////////
// He went out of his way to be good. //
////////////////////////////////////////

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own

Ed Fultz

unread,
Mar 11, 1999, 3:00:00 AM3/11/99
to
Is there any way to get rid of the warning?

--
Ed Fultz
CGI
Andover, Ma

kbc...@my-dejanews.com wrote in message <7bmvrf$698$1...@nnrp1.dejanews.com>...

kbc...@my-dejanews.com

unread,
Mar 12, 1999, 3:00:00 AM3/12/99
to new...@kbcafe.com
It's cause by twice definition this macro.
You can eliminate it by...
#1
Removing some of the definiton so that there are only one.
#2
Using "#undef STRICT" between definition.

Randy Charles Morin
Webmaster of KBCafe http://tips.kbcafe.com/tips/

Co-Author of The Waite Group's COM/DCOM Primer Pus


In article <uHd4wFAb#GA....@cppssbbsa02.microsoft.com>,

0 new messages