Displaying 1 result from an estimated 1 matches for "delete_dllclass".
2004 Nov 09
0
How to : C++ DLLs
...l.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 destroy classes of type
DllClass. The members of the class must be 'virtual' so tha...