hmm...
But you are still going to have problems because you are trying to have one object inherit the interface for another object. I'm not sure this will work. One way I think you could proceed is:
1. create one ATL object (A)
2. add all your A methods to its interface IA
3. Instead of creating a second object, add a second interface (IB) to the A object and have it inherit from IA.
4. implement all the methods for both interfaces in your object.
To add the second interface look at the link I put above in the second response.
the other way you could do it is to have your two objects ("glace" and "container"

and two ATL objects which inherit from those, then have forwarding calls to the methods:
// A.h
// REGULAR C++ OBJECT
class baseA
{
public:
void AObjectMethod();
};
// COM OBJECT
class ATL_NO_VTABLE CA :
public CComObjectRootEx<CComSingleThreadModel>,
public CComCoClass<CA, &CLSID_A>,
public IA,
public baseA
//B.h
// REGULAR C++ OBJECT
class baseB : public baseA
{
};
// COM OBJECT
class ATL_NO_VTABLE CB :
public CComObjectRootEx<CComSingleThreadModel>,
public CComCoClass<CB, &CLSID_B>,
public IB,
public baseB
{
this approach compiles for me and I can call AMethod() in CB:
STDMETHODIMP CB::Bmethod1()
{
// TODO: Add your implementation code here
this->Amethod();
return S_OK;
}
now you can use the method "AObjectMethod()" in CB with no problem because CB inherits from baseB which inherits from baseA.
But you now need to add methods to each interface which forward the calls to the master classes. So for IA you need to add an interface method like:
STDMETHOD(forwardAMethod)()
STDMETHODIMP CB::forwardAMethod()
{
AMethod();
return S_OK;
}
and "forwardAMethod" is what clients would call. In this way your existing code can be used as is without trying to force it into a com structure.
But you will have to also fiddle around with parameters and function signatures - if you have a method like
BOOL getVal(int val);
In baseA, it will have to become something like:
STDMETHODIMP CB::forwardgetVal(BOOL* b, int val)
in the CA forwarding call.