views:

71

answers:

3

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

class CP_EXPORT CP_Window : public CP_Window_Imp

What is the CP_EXPORT portion?

What does it mean/imply?

+2  A: 

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.

James McNellis
@James - So also, public CP_Window_Imp in this case means that CP_Window is based upon public CP_Window_Imp?
MLS
@ML: That means `CP_Window` derives publicly from a base class `CP_Window_Imp`. It's no different than any other C++ inheritance.
James McNellis
+2  A: 

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. 
George
I thought C-Pluff was a C framework, not sure how class would fit into it (unless there is some C++ layer on top of it)...
Eugen Constantin Dinca
A: 

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

Chris Dodd