Basic Question About Interfaces
-
In object-oriented languages, the term "interface" is often used to define an abstract type that contains no data, but exposes behaviors defined as methods. A class having all the methods corresponding to that interface is said to implement that interface. Source: WIKIPEDIA I do not understand that how certain interfaces of Media Foundation APIs are getting created and working. Take
IMFSourceReader
for example. I understand that it gets created usingMFCreateSourceReaderFromXXXX
functions. But just a function call and nothing else? - It should not be working in the first place. - What class creates and implements it in the system? Thanks for any info. -
In object-oriented languages, the term "interface" is often used to define an abstract type that contains no data, but exposes behaviors defined as methods. A class having all the methods corresponding to that interface is said to implement that interface. Source: WIKIPEDIA I do not understand that how certain interfaces of Media Foundation APIs are getting created and working. Take
IMFSourceReader
for example. I understand that it gets created usingMFCreateSourceReaderFromXXXX
functions. But just a function call and nothing else? - It should not be working in the first place. - What class creates and implements it in the system? Thanks for any info.It's not an interface that gets created, though an interface will be made available for you to call, its an object that implements the interface that gets created, in this case an object implementing the IMFSourceReader interface. The object created just exposes the interface to the outside world as a known means of using it but when you call a method (or function) on the interface, the call is immediately passed on to the object to carry out the actual work.