Re: Additional Interfaces deriving from previous interfaces - Wizard?
- From: lea@xxxxxxxxxxxxxx
- Date: 9 Aug 2005 10:48:17 -0700
This afternoon was a success - my tip for others, don't worry about
what ClassView displays! In my case CV doesn't show the inherited
methods but they are there - really...
I followed your instruction Alexander and nocked up a VB app to see
what was actually being shown to the outside world. Once I realised
that the default Interface isn't revealed in the Object Browser I could
understand that actually the inheritance was operating fine.
Code now looks like this:
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 : IMyInterface
{
[helpstring("method LeasMethodForMyInterface2")] HRESULT
LeasMethodForMyInterface2();
};
library MyInterfaceLib
{
importlib("stdole32.tlb");
importlib("stdole2.tlb");
[
uuid(B8A305A6-47C3-4DC1-A3DC-86323EDC5D53),
helpstring("MyInterface Class")
]
coclass MyInterface Class
{
[default] interface IMyInterface2;
interface IMyInterface;
};
};
---CMyInterface.cpp---------
class ATL_NO_VTABLE CMyInterface :
public CComObjectRootEx<CComMultiThreadModel>,
public CComCoClass<CMyInterface, &CLSID_MyInterfaceLL>,
public ISupportErrorInfo,
public IMyInterface2
{
public:
CMyInterface()
{
}
BEGIN_COM_MAP(CMyInterface)
COM_INTERFACE_ENTRY(IMyInterface)
COM_INTERFACE_ENTRY(IMyInterface2)
COM_INTERFACE_ENTRY(ISupportErrorInfo)
END_COM_MAP()
// IMyInterface
public:
HRESULT GeneralFunction();
STDMETHOD(LeasMethod)();
STDMETHOD(LeasMethodForMyInterface2)();
};
#endif //
Now it works a treat. Again,thanks for the pointers..
One last question (you new it was coming), now I've removed the
reliance on IDispatch (no idea why I used that, ah yes it was the
Wizard default) can I assume the caching proxy issue is now resolved?
Thanks again
Lea
.
- Follow-Ups:
- Re: Additional Interfaces deriving from previous interfaces - Wizard?
- From: Alexander Nickolov
- Re: Additional Interfaces deriving from previous interfaces - Wizard?
- References:
- Additional Interfaces deriving from previous interfaces - Wizard?
- From: lea
- Re: Additional Interfaces deriving from previous interfaces - Wizard?
- From: Alexander Nickolov
- Re: Additional Interfaces deriving from previous interfaces - Wizard?
- From: lea
- Re: Additional Interfaces deriving from previous interfaces - Wizard?
- From: Alexander Nickolov
- Re: Additional Interfaces deriving from previous interfaces - Wizard?
- From: lea
- Re: Additional Interfaces deriving from previous interfaces - Wizard?
- From: Alexander Nickolov
- Re: Additional Interfaces deriving from previous interfaces - Wizard?
- From: lea
- Re: Additional Interfaces deriving from previous interfaces - Wizard?
- From: lea
- Re: Additional Interfaces deriving from previous interfaces - Wizard?
- From: Alexander Nickolov
- Additional Interfaces deriving from previous interfaces - Wizard?
- Prev by Date: Re: BSTR CComBSTR Issues Visual Basic 6
- Next by Date: Re: BSTR CComBSTR Issues Visual Basic 6
- Previous by thread: Re: Additional Interfaces deriving from previous interfaces - Wizard?
- Next by thread: Re: Additional Interfaces deriving from previous interfaces - Wizard?
- Index(es):
Relevant Pages
|