This one is kicking my butt a little. One of the TV3D classes I'm wrapping has a virtual destructor. I wrap it like this :
But I get an access violation when I call it.
PLEASE NOTE THESE TWO THINGS :
1) The pointer is valid.
2) The actual code that's calling this is perfect. It's a straight BMax copy of a C++ demo which works fine.
So I'm quite certain that it's this virtual destructor which is getting in the way. I thought I could get around it by downcasting to the derived class, but apparently there are no public derived classes. The class is just a wrapper for some other internal stuff.
Anyway, the author has kindly offered to add another way of doing it if neither of us can come with a better solution. So I'm just posting here to see if anyone has a better solution before I ask him to add anything else.
extern "C" __cdecl void CTVMesh_Destroy(CTVMesh* Ha) { delete Ha; }
But I get an access violation when I call it.
PLEASE NOTE THESE TWO THINGS :
1) The pointer is valid.
2) The actual code that's calling this is perfect. It's a straight BMax copy of a C++ demo which works fine.
So I'm quite certain that it's this virtual destructor which is getting in the way. I thought I could get around it by downcasting to the derived class, but apparently there are no public derived classes. The class is just a wrapper for some other internal stuff.
Anyway, the author has kindly offered to add another way of doing it if neither of us can come with a better solution. So I'm just posting here to see if anyone has a better solution before I ask him to add anything else.