when do we need to define INC_OLE2?

This is a discussion on when do we need to define INC_OLE2? within the C++ Programming forums, part of the General Programming Boards category; Hello everyone,
When do we need to add code,
#define INC_OLE2
in our code? I can not find related information ...

You can manually include <ole2.h> in your application, or you can #define INC_OLE2 and then include <windows.h> and it (<ole2.h>) will be included for you. It simply seems to define whether or not including <windows.h> will also include <ole2.h>. If you don't define it before including <windows.h>, then it may or may not be loaded depending on other #define's that may be set.

"Owners of dogs will have noticed that, if you provide them with food and water and shelter and affection, they will think you are god. Whereas owners of cats are compelled to realize that, if you provide them with food and water and shelter and affection, they draw the conclusion that they are gods."
-Christopher Hitchens

Compiler is not asking for this. I am interested to learn. I read some other's code and sometimes they use #define INC_OLE2 and I want to know when do we need it and what is the function of INC_OLE2. Any ideas?

You can manually include <ole2.h> in your application, or you can #define INC_OLE2 and then include <windows.h> and it (<ole2.h>) will be included for you. It simply seems to define whether or not including <windows.h> will also include <ole2.h>. If you don't define it before including <windows.h>, then it may or may not be loaded depending on other #define's that may be set.

I could be mistaken.

Your reply is very helpful. I think you mean if we want to include ole2.h, we should either include it directly or using,

1. #define INC_OLE2;
2. #include <windows.h>

Right?

What do you mean "If you don't define it before including <windows.h>, then it may or may not be loaded depending on other #define's that may be set."? I am confused about this sentence.