COM and deriveing
-
Hello, is it possible to create a COM objects structure as below: In a dll library I define:
class T1
{
public:
STDMETHOD(Method)();
}STDMETHODIMP T1::Method()
{
AFX_MANAGE_STATE(AfxGetStaticModuleState())return S_OK;
}which implements interface:
interface IT1 : IDispatch
{
[id(1)] HRESULT Method();
};coclass T1
{
[default] interface IT1;
};and then I would like to have:
class T2 : public T1
{
//something additional
}I would like to create a COM objects from the class T2 and have all the functionality provided by class T1. E.g. I would like to call:
CComQIPtr spiT1(piT2);
spiT1->Method();Anyone can help?
-
Hello, is it possible to create a COM objects structure as below: In a dll library I define:
class T1
{
public:
STDMETHOD(Method)();
}STDMETHODIMP T1::Method()
{
AFX_MANAGE_STATE(AfxGetStaticModuleState())return S_OK;
}which implements interface:
interface IT1 : IDispatch
{
[id(1)] HRESULT Method();
};coclass T1
{
[default] interface IT1;
};and then I would like to have:
class T2 : public T1
{
//something additional
}I would like to create a COM objects from the class T2 and have all the functionality provided by class T1. E.g. I would like to call:
CComQIPtr spiT1(piT2);
spiT1->Method();Anyone can help?
-
Hello, is it possible to create a COM objects structure as below: In a dll library I define:
class T1
{
public:
STDMETHOD(Method)();
}STDMETHODIMP T1::Method()
{
AFX_MANAGE_STATE(AfxGetStaticModuleState())return S_OK;
}which implements interface:
interface IT1 : IDispatch
{
[id(1)] HRESULT Method();
};coclass T1
{
[default] interface IT1;
};and then I would like to have:
class T2 : public T1
{
//something additional
}I would like to create a COM objects from the class T2 and have all the functionality provided by class T1. E.g. I would like to call:
CComQIPtr spiT1(piT2);
spiT1->Method();Anyone can help?
Although this would work, T2 would be an ordinary class while T1 is a com class.
«_Superman_» I love work. It gives me something to do between weekends.
-
Hello, is it possible to create a COM objects structure as below: In a dll library I define:
class T1
{
public:
STDMETHOD(Method)();
}STDMETHODIMP T1::Method()
{
AFX_MANAGE_STATE(AfxGetStaticModuleState())return S_OK;
}which implements interface:
interface IT1 : IDispatch
{
[id(1)] HRESULT Method();
};coclass T1
{
[default] interface IT1;
};and then I would like to have:
class T2 : public T1
{
//something additional
}I would like to create a COM objects from the class T2 and have all the functionality provided by class T1. E.g. I would like to call:
CComQIPtr spiT1(piT2);
spiT1->Method();Anyone can help?