Click to See Complete Forum and Search --> : How to make VB ActiveX Dll functions visible to VC++


Farhan Zia
January 26th, 2000, 06:07 AM
Hello,
I am facing a problem. I am trying to call a dll file which is made in
VB in VC++ but VC does not access the fuctions that are in VB dll. What is the
problem. The DLL is a VB ActiveX DLL and when I view the dll through a DLL Viewer
it only shows the functions

1 0 DllCanUnloadNow (00002756)
2 1 DllGetClassObject (0000272A)
3 2 DllRegisterServer (00002740)
4 3 DllUnregisterServer (00002714)

which I think are added by VB wizard. and I can access these functions in VC.
How can I make it possible that VC can also access my methods or functions which
are defined in VB Dll.
Waiting for your kind reply,
Farhan Zia.

Lothar Haensler
January 26th, 2000, 06:16 AM
you have to call the methods of that VB ActiveX dll like any other COM object.
(in VC 6) use ClassWizard to Add a new class, choose the "From Typelibrary" option and select the VB ActiveX DLL.
That's it: Classwizard will have created a new class from your VB ActiveX Component.

Farhan Zia
January 26th, 2000, 06:59 AM
What if I am working with out using MFC and working as Win32 Project. in that case how can we call functions defined in VB Dll

Lothar Haensler
January 26th, 2000, 07:04 AM
in that case you could call the VB DLL methods via the IDispatch interface.