Ram wrote:
Hey,
I have a Dll I created in VB6 and when I'm trying to use it from C++
using the following code:
MyNS::MyClassPtr obj;
obj = new MyNS::MyClass();
I get the following error:
C2559: Cannot Instantiate An Abstract Class
But when I try and use the same Dll from a VB6 or .Net (using Interop)
application everything works perfectly well!
Any ideas?
Thanks ahead
--Ram
You are probably meant to use a factory method or class to instantiate
the object. Something like this
// factory class
MyNS::MyClassFactory factory;
MyNS::MyClassPtr ptr = factory.create();
or this
// factory method
MyNS::MyClassPtr ptr = MyNS::MyClass::create();
but without knowing anything about VB6 or .NET I couldn't say precisely
what you need to do, but it's likely to be something on the above lines.
john