1.创建“Win32 Console Application”项目,命名为“ClassDllLib”,并在“Application type”中选择“DLL”

2.创建Student.h文件

#define DllExport __declspec(dllexport)

class DllExport Student
{
private:
	int id;
public:
	void setID(int id);
	int getID();
};

3. 创建Student.cpp文件

4.创建“Win32 Console Application”项目,并在“Application type”中选择“Console application”。

5.在含有main函数的类中做如下调用:






相关文章:

  • 2022-12-23
  • 2021-11-15
  • 2021-12-05
  • 2022-01-04
  • 2021-12-04
  • 2022-12-23
  • 2021-04-29
  • 2022-12-23
猜你喜欢
  • 2021-08-07
  • 2021-06-03
  • 2022-01-25
  • 2021-10-26
  • 2021-11-22
相关资源
相似解决方案