Using IUnknown derived C++ COM object in VB6
I have developed a C++ DLL-based COM object that implements some IUnknown derived in开发者_运维技巧terface. 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?!
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.
If the interface is only derived from IUnknown and not IDispatch , you can use early binding in VB6.
精彩评论