On Tue Mar 7 06:01:17 2023 +0000, Mohamad Al-Jaf wrote:
Isn't an implementation of `ISpatialSurfaceObserverStatics` needed by `ISpatialSurfaceObserverStatics2`? That's what I understood from the `requires` keyword.
There's the IDL side and the C implementation side. The `requires` keyword is only checked and enforced on the IDL side, although I'm not sure it's even very strict, and it means that if a class declares the `ISpatialSurfaceObserverStatics2` interface, it needs to declare the `ISpatialSurfaceObserverStatics` interface too.
On the C side, nothing is enforced, and although you are supposed to implement the interfaces that were declared in the IDL, it will only be a problem to not have them when something queries it. Some interfaces like `IAgileObject` are completely trivial to add, so we usually add them right away (although I think incorrectly putting them with the default interface), but otherwise you don't have to implement interfaces that are never used.
Then, even on the IDL side, declaring an interface doesn't necessarily mean you need to have its definition either, and a forward declaration is sometimes enough. You only need the definition for the default runtimeclass interfaces, as the interface UUID is then required for some things (I'm not sure anymore about the details).