devxlogo

Use the Dual Interface Instead of vtbl only or Pure Interfaces

Use the Dual Interface Instead of vtbl only or Pure Interfaces

The COM client and server can communicate with each other in three ways – vtbleinterfaces, dispinterface or dual interface.

If the component is to be used only from compiled languages such as C and C++, you should use a vtbl or normal COM interface. These vtbl interfaces are much faster than dispinteraces. They are much easier to access from a C++ program.

If your component is to be accessed by VB or Java, you should implementa dual interface. VB or Java can access a dual interface either throughdispinterface side or vtbl side. C++ user can also access either side of thedual interface. So, dual interface interfaces are much more versatile to use. Unless you really need to build component at run time, you should avoid puredispinterfaces.

devx-admin

Share the Post: