Help accessing VB ActiveX DLL from C using only Win32 
Author Message
 Help accessing VB ActiveX DLL from C using only Win32

We would like to create "add-in" to our product using VB to
create dlls.

We have an older application, written in C. It was ported
from unix using a cross-platform gui tool (Neuron Data) so
there is no MFC, no C++ etc.

We have managed to expose the bulk of the business logic in
a Win32-type dll (no com, ole, automation) that is callable
from VB, just as any of the other Windows dlls.

We are using VB6.0 and VC++6.0
(for compiling and debugging only - we build from makefiles).

VB seems to only allow you to create a dll that is an ActiveX
dll.  This would be ok if we could figure out how to create
our own "interface" function that would allow our app to
activate the dll.  In other words, we'd like to expose some
function in the dll that we could call from our application.

We'd rather avoid adding full COM/OLE automation support into
our application at this point. It seems that the only exported
functions are the standard ones:

 DllCanUnloadNow
 DllGetClassObject
 DllRegisterServer
 DllUnregisterServer

Do we want to call these funcs, especially DllGetClassObject
in order to access the classes and funcs in the ActiveX dll?
Or is there some other way to accomplish our task?

Thanks
Richard Gold



Sat, 02 Feb 2002 03:00:00 GMT  
 Help accessing VB ActiveX DLL from C using only Win32

Quote:

>VB seems to only allow you to create a dll that is an ActiveX
>dll.

True.

Quote:
>We'd rather avoid adding full COM/OLE automation support into
>our application at this point.

Unfortunately, you must. As you said, VB only creates ActiveX
DLLs. You do not need to work with MFC to do this, although
using C++ and some COM helper classes MS created
(bstr_t, variant_t, and comptr_t) will make it much easier.

Quote:
>It seems that the only exported
>functions are the standard ones:

> DllCanUnloadNow
> DllGetClassObject
> DllRegisterServer
> DllUnregisterServer

>Do we want to call these funcs, especially DllGetClassObject
>in order to access the classes and funcs in the ActiveX dll?

No. Note from MSDN:

    'You should not call DllGetClassObject directly. When an
    object is defined in a DLL, CoGetClassObject calls the
    CoLoadLibrary function to load the DLL, which, in turn,
    calls DllGetClassObject.'

Quote:
>Or is there some other way to accomplish our task?

Just using COM.


Sat, 02 Feb 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Using VC++ to access ActiveX DLL created by VB

2. HELP: Using ClassWizard to access VB DLL :HELP

3. Problem using VB 5 activex DLL in a VC++ activex control

4. Using vb.net classes in C++ Win32 DLLs

5. Creating a DLL for ActiveX access to VB

6. Variable variant access with an ACTIVEX DLL VB ??

7. VB ACTIVEX DLL Access to a Variant Variable ???

8. accessing objects in a c++ DLL from a c++ activeX control placed in a VB application

9. accessing objects in a c++ DLL from a c++ activeX control placed in a VB application

10. Using VB ActiveX DLL Class in IDL

11. Using VB ActiveX DLL in raw C++??

12. Problem in using VB Activex dll in Atl service

 

 
Powered by phpBB® Forum Software