 |
C++Talk.NET C++ language newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Ram Guest
|
Posted: Sun Nov 27, 2005 11:01 am Post subject: Calling VB6 Dll From C++ |
|
|
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
|
|
| Back to top |
|
 |
John Harrison Guest
|
Posted: Sun Nov 27, 2005 4:19 pm Post subject: Re: Calling VB6 Dll From C++ |
|
|
Ram wrote:
| Quote: | 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
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|