Re: Additional Interfaces deriving from previous interfaces - Wizard?

Tech-Archive recommends: Fix windows errors by optimizing your registry



Uhm, so I thought I'd try early binding (deselect the dual option in
the Wizard, make IMyInterface2 :IMyInterface -still couldn't see
IMyInterfaces beneath in ClassView.

So, back to the Wiz:

Added IMyInterface2 to the idl file manually (derived from IUknown)
and its reference to default in the coclass definition.

Ran the Implement Interface wizard

Copied the methods of IMyInterface and added to IMyInterface2:

----idl----

[
object,
uuid(234234234-5BA6-420F-BC21-1D6E5366A75F),

helpstring("MyInterface"),
pointer_default(unique)
]
interface MyInterface: IUnknown
{
[helpstring("method LeasMethod")] HRESULT LeasMethod();
};

[
object,
uuid(234234234234-47a0-AAD5-74B6787419FF),

helpstring("MyInterface2"),
pointer_default(unique)
]
interface IMyInterface2 : IUnknown
{
[helpstring("method LeasMethod")] HRESULT LeasMethod();
};

---CMyInterface.cpp---------

class ATL_NO_VTABLE CMyInterface :
public CComObjectRootEx<CComMultiThreadModel>,
public CComCoClass<CMyInterface, &CLSID_MyInterfaceLL>,
public ISupportErrorInfo,
public IMyInterface,
public IMyInterface2
{
public:
CMyInterface()
{
}

BEGIN_COM_MAP(CMyInterface)
COM_INTERFACE_ENTRY(IMyInterface)
COM_INTERFACE_ENTRY(ISupportErrorInfo)
COM_INTERFACE_ENTRY(IMyInterface2)
END_COM_MAP()

// IMyInterface
public:
HRESULT GeneralFunction();
STDMETHOD(LeasMethod)();
// IMyInterface2
};

#endif //


Compiles fine, but does it still suffer from proxy issues (bet that
depends what threading model I chose; it was 'both' as I need both)?
You can probably tell I'm relying on three or four books (none of which
explain how to inherit!) and the wizard :-( and getting nowhere for
what should be an obvious requirement.

Maybe I'll simply ignor the proxy issues as my clients will create Free
models (not sure how VB clients acheive this).

Lea

.



Relevant Pages