Hi,
I am trying to write a sample COM.
VC++ IDE provides a wizard to create a Simple COM object.
However, it always creates the COM object with IDispatch support.
For some reasons, I need to create a Simple COM object implementing the following IDL with the following requirements:
-- Must be COM exe
-- Must not be derived from IDispatch but IUnknown only
-- Must be a singleton
[
uuid(94EE69BF-4387-4078-B33F-1E9B471D128E),
version(1.0),
helpstring("Sample 1.0 Type Library"),
)
]
{
importlib("stdole2.tlb");
interface ISample;
[
uuid(7CEBF979-C4EB-48eb-BE06-FBA1B4929FE7),
version(1.0)
]
coclass CSample
{
[default] interface ISample;
};
[
odl,
uuid(E3B868FC-7A58-4f28-B895-922D2BE7797F),
oleautomation
]
interface ISample : IUnknown
{
HRESULT _stdcall CreateTester([out, retval] IUnknown** ppTester);
HRESULT _stdcall Initialize();
HRESULT _stdcall Uninitialize();
HRESULT _stdcall get_Name([out, retval] BSTR* Name);
HRESULT _stdcall GetSettings([out, retval] IUnknown** ppSettings);
HRESULT _stdcall GetList([out, retval] VARIANT* VarList);
HRESULT _stdcall SetList([in] VARIANT VarList);
};
};
I created an ATL COM project this using VC++ wizard and tried to stripping off IDispatch out of it.
However, it turned out to be too difficult job to give up.
Can someone write a COM project satisfying the above requirements please?
Thank you.
--
HaeRim Lee