Link to home
Start Free TrialLog in
Avatar of Steve Frase
Steve FraseFlag for United States of America

asked on

Implementing a C++ Class for use in Visual Basic

I have written a difficult class in C++ that I need to access from Visual Basic.  I have written Dlls in C++ in the past that exported functions, but, never a class.
I have looked at the __stdcall and the .def file, but, I can see no way to export the class itself, only it's functionality.
In such a case, I would consider using COM, or possibly starting over and creating the same functionality without using a class, but, I really don't want to.  Can anyone tell me the best approach to taking my existing C++ class and making the class itself accessible to VB?
Avatar of Dexstar
Dexstar

@Steve_Frase:

>  Can anyone tell me the best approach to taking my existing C++ class and
> making the class itself accessible to VB?

I don't think that you can.  I think you'll need to make a COM wrapper around the class to make it usable in VB.  But if you do, then you can use it in any language.  :)

Hope That Helps,
Dex*
Avatar of Steve Frase

ASKER

How difficult is the COM wrapper, and any tips on getting started?
I have the book from MS Press "Inside COM" but it's overkill, I think!
ASKER CERTIFIED SOLUTION
Avatar of Dexstar
Dexstar

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of jkr
jkr
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
No comment has been added lately, so it's time to clean up this question.
I will leave the following recommendation for this question in the Cleanup topic area:

Split: Dexstar {http:#10335405} & jkr {http:#10335503}

Please leave any comments here within the next four days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Tinchos
EE Cleanup Volunteer