Re: How to create automation project with ATL
On Nov 6, 10:55 pm, "Igor Tandetnik" <itandet...@mvps.org> wrote:
Faisal <faisal...@gmail.com> wrote:
[
uuid(56333924-493D-4009-BC68-3A6FE8B4CC9A),
helpstring("Math Class")
]
coclass Math
{
[default] interface IArithemetic;
interface ICompare;
};
};
Show the declaration of your Math coclass in C++, including the
interface map.
Unless you do certain extra work, it is illegal for a coclass to
implement more than one dual interface.
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925
My coclass declaration
class ATL_NO_VTABLE CMath :
public CComObjectRootEx<CComSingleThreadModel>,
public CComCoClass<CMath, &CLSID_Math>,
public IDispatchImpl<IArithemetic, &IID_IArithemetic,
&LIBID_MATHSLib>,
public IDispatchImpl<ICompare, &IID_ICompare, &LIBID_MATHSLib>
{
public:
CMath()
{
}
DECLARE_REGISTRY_RESOURCEID(IDR_MATH)
DECLARE_PROTECT_FINAL_CONSTRUCT()
BEGIN_COM_MAP(CMath)
COM_INTERFACE_ENTRY(IArithemetic)
COM_INTERFACE_ENTRY(ICompare)
END_COM_MAP()
// IArithemetic
public:
STDMETHOD(Product)(/*[in]*/ long X, /*[in]*/ long Y, /
*[out,retval]*/ long *Result);
STDMETHOD(Sum)(/*[int]*/ long X, /*[in]*/ long Y, /*[out,retval]*/
long *Result);
STDMETHOD(Max)(/*[int]*/ long X, /*[in]*/ long Y, /*[out,retval]*/
long *Result);
};
BTW, what is this dual interface?