C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Calling VB6 Dll From C++

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language (comp.lang.c++)
View previous topic :: View next topic  
Author Message
Ram
Guest





PostPosted: Sun Nov 27, 2005 11:01 am    Post subject: Calling VB6 Dll From C++ Reply with 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

Back to top
John Harrison
Guest





PostPosted: Sun Nov 27, 2005 4:19 pm    Post subject: Re: Calling VB6 Dll From C++ Reply with quote



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
Display posts from previous:   
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language (comp.lang.c++) All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.