Listing 4 Using the IInterface interface
// By defining the following classes ... class SomeStruct : public SOMESTRUCT { // Construction SomeStruct(int i, short s) { this->i = i; this->s = s; } ... }; class Class2 : public IOther { ... }; // ... one can write validly, from within C++, the following code. void funcX(IInterface *pii, Class2 &cls2) { ... SomeStruct some(65536, 256); pii->NonNullMethod(some, cls2); ... }