Re: exporting classes in a DLL

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance





Rodrigo Corral [MVP] wrote:

// in your header...

class __declspec(dllexport) CDllTest
{
public:
  CDllTest(){}
  ~CDllTest(){}

public:
  void SayHello();
};

// in your cpp...

void CDllTest::SayHello()
{
 printf(_T("Hello World!!"));
}

Another option: if you create a new dll project using VS it will create an example dummy exported class.



Thanks - but that's on the exporting side of things. I wanted to know how to use the exported classes in a seperate project that imports the classes and uses them. The code you gave above, only shows how to export the classes (which I already know how to do).


mtia

.