I have a pure virtual base class called IVSystemDLL. I also have a class called CVSystemDLL which inherits from IVSystemDLL. When I create a new
CVSystemDLL and convert it to a IVSystemDLL *, and try to use one of it's functions, I get an access violation.
It's not something inside the function that's causing the access violation because I've put a break point inside the function and it doesn't get hit.
This is my code (snipped):
class IVSystemDLL
{
public:
virtual void Main( HINSTANCE hInstance, HINSTANCE hPrevInstance, char *lpCommandLine, int nCmdShow ) = 0;
};
class CVSystemDLL : public IVSystemDLL
{
CWindow window;
public:
void Main( HINSTANCE hInstance, HINSTANCE hPrevInstance, char *lpCommandLine, int nCmdShow );
};
int main( int argc, char **argv )
{
IVSystemDLL *pSystem = static_cast< IVSystemDLL * >( new CVSystemDLL );
pSystem->Main( NULL, NULL, NULL, 0 );
}