COM interfaces

The dual interface in COM is the one that is accessible through DispInterface or through VTable methods.

Now can someone tell me what exactly happens between these two methods?

I thought VTable is a virtual table that contains pointers to various functions when implementing a class hierarchy, which has virtual functions that can be overridden in child classes. However, I do not see how this relates to the dual interface in COM?

+5
source share
3 answers

The main difference is in the way the methods of the object are called. If DispInterface is called, the IDispatch :: Invoke method is executed (used in scripts or in the absence of an interface description), see notes . This method is much slower than the second option. In the second case, VTable is used directly for method calls (used for calls from C ++ or .NET)

+3
source

In short, COM is a binary specification, not a language specification. In fact, there is no relationship between the two interfaces and getting classes in code. Apples and oranges.

VTable is an "early call" and therefore faster. You know the type of method that you call at compile time.

DispInterface "" , , , . . .

, .

+2

.

COM, VBScript/JScript "" ASP, IDispatch.

Visual Basic 6 VBA MS Office . COM, " " (IUnknown VTable). COM VB6 VBA CreateObject ( "ProgIdName" ), " ".

, COM VB6/VBA ect. IUnknown. oleautomation. , COM oleautomation (. http://msdn.microsoft.com/en-us/library/aa367129%28VS.85%29.aspx). DLL, , , VB6/VBA COM. , COM InProc, DLL, COM, . , COM. COM DLL , COM, , COM-, , COM .

, , , COM.

+1

All Articles