OT: Defined before windows

J

JKop

I hear that to write a proper C++ program for Windows, you
should declare certain macros before including "windows.h".

Could some-one please tell me what these are and/or point
me to a nice site that would explain them.


Thanks,

-JKop
 
I

Ioannis Vranos

JKop said:
I hear that to write a proper C++ program for Windows, you
should declare certain macros before including "windows.h".

Could some-one please tell me what these are and/or point
me to a nice site that would explain them.


Check MS newsgroups. However my recommendation on the subject is .NET.
 
U

Unforgiven

JKop said:
I hear that to write a proper C++ program for Windows, you
should declare certain macros before including "windows.h".

This would be better suited to a Windows group.
Could some-one please tell me what these are and/or point
me to a nice site that would explain them.

It's not really necessary, afaik. What you mean however is most likely the
version macros. It is recommended to define the _WIN32_WINNT macro or the
_WIN32_WINDOWS macro ìn addition to the WINVER macro to hold the value of
the Windows version you're targetting, like this:
#define _WIN32_WINNT 0x0501
#define WINVER 0x0501

See:
http://msdn.microsoft.com/library/en-us/winprog/winprog/using_the_windows_headers.asp

There's also the WIN32_LEAN_AND_MEAN macro that most people define before
#include <windows.h> because it instructs it to leave out certain rarely
used parts which greatly improves compile time.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,176
Messages
2,570,949
Members
47,500
Latest member
ArianneJsb

Latest Threads

Top