开发者

CP_EXPORT in class declaration in C++

What does it mean when a class is declared like this:

class CP_开发者_运维百科EXPORT CP_Window : public CP_Window_Imp

What does the CP_EXPORT portion mean/imply?


CP_EXPORT is most probably a macro to conditionally export or import the class from a dynamic library.

For example, when using Visual C++, a macro is used to conditionally select between using dllexport and dllimport. This allows the same header to be used for both the project building the DLL itself and any projects that link against or load the DLL.


Are you using C-Pluff?

Defines:

#define     CP_EXPORT
    Declares a symbol to be exported for inter-module usage. 
#define     CP_IMPORT
    Declares a symbol to be imported from another module. 
#define     CP_HIDDEN
    Declares a symbol hidden from other modules. 


CP_EXPORT is a macro that expands to some compiler-specific special construction (probably __declspec in MSVC or __attribute__ in gcc) that does something. To find out exactly what, you'll need to search for the definition of the CP_EXPORT macro

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜