Re: Additional Interfaces deriving from previous interfaces - Wizard?

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



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-74­B6787419FF),

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<CComMultiThre­adModel>,
public CComCoClass<CMyInterface, &CLSID_MyInterfaceLL>,
public ISupportErrorInfo,
public IMyInterface2
{
public:
CMyInterface()
{
}


BEGIN_COM_MAP(CMyInterface)
COM_INTERFACE_ENTRY(IMyInterfa­ce)
COM_INTERFACE_ENTRY(IMyInterfa­ce2)
COM_INTERFACE_ENTRY(ISupportEr­rorInfo)
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

.



Relevant Pages

  • Re: Using "implements"
    ... How to us inheritance in Access? ... which had a msgBox statement in its load event as well. ... "Implements IMyInterface" tells the compiler ... the "interface" IMyInterface. ...
    (microsoft.public.access.formscoding)
  • Re: Why not multiple inheritance in C# and java
    ... You can mimic MI by delegating your interface to a class implementing the same interface right? ... IMyInterface GetMyInterface() ... I don't even use databases at the moment that use table inheritance at all, let alone multiple table inheritance, wich one do you use? ... However, on the client, I must provide all controls that are capable of talking my specific Web Service schema to the server, but I must inherit from the standard WinForms controls. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Tired of 100s of stupid Getter/Setter methods
    ... but interface does not hide the other methods of implementing ... telling you that you need to refactor a new common superclass. ... Again, composition instead of inheritance. ... A StringVector cannot take Integer parameters. ...
    (comp.lang.java.programmer)
  • Re: A taxonomy of types
    ... (I do not see why inheritance is required here.) ... without an »object-oriented programming language«, for example, ... in the programming language used. ... indirectly) implements an interface IA whose declaration ...
    (comp.lang.misc)
  • Re: Why not multiple inheritance in C# and java
    ... "mirror" of the innards of the business objects. ... Windows control type, and that offends me. ... > You can mimic MI by delegating your interface to a class implementing the ... > IMyInterface GetMyInterface() ...
    (microsoft.public.dotnet.languages.csharp)