문제

Sorry for the beginner question.

In really good article Com in plain C I read this sentence:

One requirement of a COM object is that the first three members of our VTable (i.e., our IExampleVtbl struct) must be called QueryInterface, AddRef, and Release.

Is this true?

What if change names, but parameters, calling convention and return values will be same ?

Do you still work this? If not why?

Many thanks for response. (Positive or negative.)

도움이 되었습니까?

해결책

Every COM interface must derive from IUnknown. Which provides essential services: memory management (AddRef and Release) and the ability to discover other interfaces implemented by the COM object (QueryInterface). The v-table for a COM interface therefore always starts with 3 function pointers to the implementation of these methods. The actual names of the functions or what language they were written in do not matter at all, COM only cares about the function pointers.

You can name the implementation functions anything you want. Intentionally not using the IUnknown function names is unwise.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top