What does this c++ class declaration mean?

前端 未结 2 1452
面向向阳花
面向向阳花 2020-12-12 00:18

I saw this piece of code in an article I am reading.

class EXAMPLEUNMANAGEDDLL_API CUnmanagedTestClass
{
public:
    CUnmanagedTestClass();
    virtual ~CUn         


        
2条回答
  •  一整个雨季
    2020-12-12 01:11

    Such constructs are used in Windows to control whether the class is being used while building a DLL or it is being used to build a user of the DLL.

    When building the DLL, EXAMPLEUNMANAGEDDLL_API needs to expand to __declspec(dllexport).

    When buidling users of the DLL, EXAMPLEUNMANAGEDDLL_API needs to expand to __declspec(dllimport).

    Further information can be found at:

    1. Exporting from a DLL Using __declspec(dllexport)
    2. Importing into an Application Using __declspec(dllimport)

提交回复
热议问题