Dll Header

This is a discussion on Dll Header within the Windows Programming forums, part of the Platform Specific Boards category; Code: #ifndef _DLL_H_ #define _DLL_H_ #if BUILDING_DLL # define DLLIMPORT __declspec (dllexport) #else /* Not BUILDING_DLL */ # define DLLIMPORT ...

  1. #1
    Registered User
    Join Date
    Jul 2008
    Posts
    6

    Dll Header

    Code:
     #ifndef _DLL_H_
    #define _DLL_H_
    
    #if BUILDING_DLL
    # define DLLIMPORT __declspec (dllexport)
    #else /* Not BUILDING_DLL */
    # define DLLIMPORT __declspec (dllimport)
    #endif /* Not BUILDING_DLL */
    
    
    DLLIMPORT void HelloWorld (void);
    
    
    #endif /* _DLL_H_ */
    Here is a standard devc++ header file for a dll.
    What does BUILDING_DLL mean and if I change the name of the header file to loop.h should i change _DLL_H_?

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    BUILDING_DLL would (one can presume) be set if the IDE thinks that it's currently building a DLL, as opposed to when it is USING an external DLL.

    It is considered good style to have some sort of relationship between the include guards and the filename [or rather, you don't want "loop.h" to prevent you from including a valid "dll.h" later on in life].

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Checking array for string
    By Ayreon in forum C Programming
    Replies: 87
    Last Post: 03-09-2009, 04:25 PM
  2. dll communicating between each other
    By cloudy in forum C++ Programming
    Replies: 5
    Last Post: 06-17-2005, 03:20 AM
  3. DLL and std::string woes!
    By Magos in forum C++ Programming
    Replies: 7
    Last Post: 09-08-2004, 01:34 PM
  4. Request for comments
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 01-02-2004, 10:33 AM

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