Controlling Filter Graphs Using C
If you are writing a DirectShow application in C (rather than C++), you must use a vtable pointer to call methods. The following example illustrates how to call the IUnknown::QueryInterface method from an application written in C:
The following shows the equivalent call in C++:
In C, COM interfaces are defined as structures. The lpVtbl member is a pointer to a table of interface methods (the vtable). All methods take an additional parameter, which is a pointer to the interface.