|
-
July 25th, 2000, 08:38 AM
#1
Using VC++ 6 Classes in DLL in VB6
I have created a DLL in VC++ 6 that has 3 classes and is used for a simple file conversion. One classe performs all of the work, while the other 2 classes are used within the first one. The main class has a function called Convert() that performs all of the work, but I don't know how to call that function from within VB 6. What do I have to do since the function is a part of a Class and not stand-alone??
={ S. Kyle Korndoerfer }=
-
July 25th, 2000, 09:20 AM
#2
Re: Using VC++ 6 Classes in DLL in VB6
two options:
- turn your VC app into a DLL and create an extern "C" style function that can be exported and call it from VB via a Declare & call statement
- turn your VC app into an ActiveX DLL, an automation component. VB can call COM components via CreateObject...
-
July 27th, 2000, 10:20 AM
#3
Re: Using VC++ 6 Classes in DLL in VB6
I am relatively new to creating Active X/COM objects, but have read up on a basic ATL COM object and incorporated it into Visual Basic. I am however at a slight lose when it comes to applying my classes in this manner. I have one class that does all of the work with 2 support classes, ie...
OCC2RR
|--> List
|--> Node
The OCC2RR class contains all of the functions to perform the actual conversion via a call to a function called Convert(). How would I go about creating the ATl COM object for this example? Or am I missing a more simplistic approach?
={ S. Kyle Korndoerfer }=
-
July 27th, 2000, 04:09 PM
#4
Re: Using VC++ 6 Classes in DLL in VB6
Nevermind.. I have built the ATL COM object, incorporated it into VB, and it is working.
The only hurdle left to clear is being able to pass the filename and path to the ATL COM Object so that it will work with any file selected by the user. Any quick suggestions?
={ S. Kyle Korndoerfer }=
-
July 28th, 2000, 02:01 AM
#5
Re: Using VC++ 6 Classes in DLL in VB6
I am NOT an ATL expert.
In an MFC Appwizard bases ActiveX dll I'd simply expose a public method that takes a BSTR as an argument and stores that value in a class member variable.
-
July 28th, 2000, 01:30 PM
#6
Re: Using VC++ 6 Classes in DLL in VB6
Lothar is rught pass the Filename and path as a BSTR. Keep in mind if you have a path C:\Windows\System32\crackers.dll
the slashes mean somthing in C++ for example "print this line \n on two lines"
the \n means new line. So before you pass the filename and path you may have to change it to look like c:\\Windows\\System32\\crackers.dll
Wasn't sure if you were having problems passing the filename or just didn't know what type to make it. I would test this because I can't remeber if you have to use \\ in a bstr or can get by with a single \.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|