search for: new_dllclass

Displaying 1 result from an estimated 1 matches for "new_dllclass".

2004 Nov 09
0
How to : C++ DLLs
...in Windows that works great: Define your class in a common header (let's call it dll.hpp): class DllClass { public: int somedata; virtual void member(int arg); }; Define the DLL source with two exports: #include <dll.hpp> extern "C" __declspec(dllexport) DllClass *new_DllClass() { return new DllClass; } extern "C" __declspec(dllexport) void delete_DllClass(DllClass *x) { delete x; } void DllClass::member(int arg) { //do something with arg.. } Then in your main source code just load the DLL, get the addr of new_DllClass and delete_DllClass to create and...