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 ...

  1. #1
    Registered User
    Join Date
    May 2006
    Posts
    1,579

    when do we need to define INC_OLE2?

    Hello everyone,


    When do we need to add code,

    #define INC_OLE2

    in our code? I can not find related information from MSDN.


    thanks in advance,
    George

  2. #2
    Unregistered User Yarin's Avatar
    Join Date
    Jul 2007
    Posts
    1,623
    When and where does the compiler ask for it?
    A class that doesn't overload all operators just isn't finished yet. -- SmugCeePlusPlusWeenie
    A year spent in artificial intelligence is enough to make one believe in God. -- Alan J. Perlis

  3. #3
    Registered User hk_mp5kpdw's Avatar
    Join Date
    Jan 2002
    Location
    Northern Virginia/Washington DC Metropolitan Area
    Posts
    3,801
    From my meager diggings...

    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.
    "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

  4. #4
    Registered User
    Join Date
    May 2006
    Posts
    1,579
    Thanks Yarin,


    Quote Originally Posted by Yarin View Post
    When and where does the compiler ask for it?
    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?


    regards,
    George

  5. #5
    Registered User
    Join Date
    May 2006
    Posts
    1,579
    Thanks hk_mp5kpdw,


    Quote Originally Posted by hk_mp5kpdw View Post
    From my meager diggings...

    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.


    regards,
    George

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Pointer within a Struct
    By Bladactania in forum C Programming
    Replies: 11
    Last Post: 04-03-2009, 10:20 PM
  2. Why?!?
    By p3rry in forum C Programming
    Replies: 3
    Last Post: 01-08-2009, 11:52 AM
  3. size of an integer pointer
    By onebrother in forum C Programming
    Replies: 5
    Last Post: 07-09-2008, 11:49 AM
  4. edit controls in dialogs
    By Homunculus in forum Windows Programming
    Replies: 10
    Last Post: 02-23-2006, 02:38 PM
  5. Please STICKY this- vital to MSVC 6 dev - BASETSD.h
    By VirtualAce in forum Game Programming
    Replies: 11
    Last Post: 03-15-2005, 08:22 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21