Use Depends to look at the DLL. You can see all the exported symbols.
I don't think you have a problem exporting your class if you can link to if implicitly. The problem is in naming. The exported class name and methods will be mangled. There is no standard name mangling scheme.
When viewing the symbol names in Depends, you need to see the "undecorated" C++ names. Depends can show you decorated name, i.e. names you'd recognise; and undecorated names, the names as they really exist.
You should be aware that there is no standard for mangling names, so it's unwise to try to use them yourself. If you can get the tools to use them automatically, fine; but you shouldn't be trying to use these names yourself.
One way around the problem is to use a C interface. It's easy to think of it as resorting to the lowest common denominator, a sort of race to the bottom, but it allows your DLL to be used from any language available on Windows. Remember C++ was designed for library creation and Windows' native interface is C.
One way is to create open/close functions that create/destroy the object. The handle that's passed around can be the this pointer reinterpreted as an int.
e.g.
1 2 3
int mything_open(constchar* param1, int param2);
void mything_dowork(int handle);
void mything_close(int handle);
extern"C"int mything_open(constchar* param1, int param2)
{
if (MyThing* p = new MyThing(param1, param2))
returnreinterpret_cast<int>(p);
return 0;
}
extern"C"void mything_dowork(int handle)
{
if (MyThing* p = reinterpret_cast<MyThing*>(handle))
p->DoWork();
}
extern"C"void mything_close(int handle)
{
if (MyThing* p = reinterpret_cast<MyThing*>(handle))
delete p;
}