How do you call VB ActiveX DLL functions from VC 
Author Message
 How do you call VB ActiveX DLL functions from VC

Hi All

I wonder if anyone can help - I have been fiddling around using Classwizard
and adding a class to my project with 'using a type library'  to enable me
to call functions from a VB ActiveX DLL.

Thanks in anticipation.
Graham



Sat, 07 Jun 2003 18:43:36 GMT  
 How do you call VB ActiveX DLL functions from VC
I usually simply use the #import feature, something like
(without error checking):

#include <windows.h>
#import "myvbdll.dll" no_namespace

int main(int argc,char**argv)
{
CoInitialize(0);
{
    MyVbInterfacePtr pObject;

    pObject.CreateInstance( __uuidof(MyVbObject));
    // go ahead and use pObject

Quote:
}

CoUninitialize();
return 0;

Quote:
}

the #import statement will generate 2 include files in your "output"
directory (either Debug or Release),
named xxx.tlh and xxx.tli, where xxx is the name of the dll

I suggest you open the xxx.tlh file if youre unsure what names the VB
interface/class
has been assigned...

/johan


Quote:
> Hi All

> I wonder if anyone can help - I have been fiddling around using
Classwizard
> and adding a class to my project with 'using a type library'  to enable me
> to call functions from a VB ActiveX DLL.

> Thanks in anticipation.
> Graham



Sat, 07 Jun 2003 22:33:34 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Help - Calling ActiveX DLL function from VB and C++ returns different values

2. VB callback function, called from a VC DLL, crashes

3. How to call function in VB from Dll with VC

4. Help: Need to export VC 5.0 function in DLL to be called from VB 5.0

5. Creating c dll calling vb ActiveX dll

6. How to call VB functions in VB dlls from VC++

7. calling VB activex control from VC

8. VC calling VB ActiveX cuases Problems--HELP!

9. what is the diffrence between Activex DLL in VB and ATL COM in VC

10. Atl NT service calling VB ActiveX dll had problem when clean-up

11. Call/Use VB ActiveX Dll in Visual C

12. calling vb activex dll

 

 
Powered by phpBB® Forum Software