ezpresso
ezpresso

Reputation: 8126

Using IUnknown derived C++ COM object in VB6

I have developed a C++ DLL-based COM object that implements some IUnknown derived interface. How can I use it in VB6? Does VB6 support IUnknown based interfaces, or I need to derive from IDispatch?

UPDATE

I have not used ATL. The implementation is based on A very simple COM server without ATL or MFC article. Seems like I need to generate a .tlb file for my object?!

Upvotes: 2

Views: 917

Answers (2)

parapura rajkumar
parapura rajkumar

Reputation: 24403

If the interface is only derived from IUnknown and not IDispatch , you can use early binding in VB6.

Upvotes: 3

Sven
Sven

Reputation: 22673

You do not need to use IDispatch; that's only required for late binding.

To use your object you must add a reference to the object's type library to your VB6 project.

Upvotes: 3

Related Questions