Why do C++ class definitions on Windows often have a macro token after 'class'? -
I am trying to understand an open source project, where I came in a declaration of the following category:
Class STATE_API AttributeSubject: Public Attribution Group, Public Subject {Public: Attribute Subject (const char *); Virtual ~ feature theme (); Virtual Zero SelectAll () = 0; Virtual const std :: string TypeName () console; Virtual Zero Notification (); Virtual Attributes * CreateComedContact (Const Strude :: String and Shouldst); Virtual Attributes * New instance (Bull copy) Const {Return 0; }; Virtual Bull VarChangeRequetReset (Zero) {return false; }; };
What does STATE_API indicate before the class name AttributeSubject? Is this some kind of macro?
This is probably __declspec (dllimport) or __declspec (dllexport)
Neil is right , This is a macro.
This usually looks like this:
#FIDF INDSIDE_DLL # define STATE_API __declspec STATE_API __declsped (dllimport) #endif
You define INSIDE_DLL only in your DLL and export all sections declared with STATE_API macro. / P>
Comments
Post a Comment