I've inherited a project that includes a COM DLL. I'm sort of new to COM but something doesn't seem right. The interface defined in the IDL only uses the VARIANT
type for all properties and method returns/parameters. Is there any possible justification for this? I have a feeling the previous developer was just winging some things, but I want to be sure.
Here's what my IDL looks like:
interface IMyComInterface : IDispatch
{
[id(1), helpstring("method CheckMessage")] HRESULT CheckMessage([in] VARIANT vMsg);
[id(2), helpstring("method CheckFolder")] HRESULT CheckFolder([in] VARIANT Folder, [out] VARIANT *pCount, [out, retval] VARIANT *pErrorCount);
[propget, id(3), helpstring("property Flags")] HRESULT Flags([out, retval] VARIANT *pVal);
[propput, id(3), helpstring("property Flags")] HRESULT Flags([in] VARIANT newVal);
[propget, id(4), helpstring("property MessageStore")] HRESULT MessageStore([out, retval] VARIANT *pVal);
[propput, id(4), helpstring("property MessageStore")] HRESULT MessageStore([in] VARIANT newVal);
[propget, id(5), helpstring("property Directory")] HRESULT Directory([out, retval] VARIANT *pVal);
[propput, id(5), helpstring("property Directory")] HRESULT Directory([in] VARIANT newVal);
[propget, id(6), helpstring("property MessageCount")] HRESULT MessageCount([out, retval] VARIANT *pVal);
};
Much thanks.
EDIT:
To make things clear, all of these VARIANT
s could be replaced by explicit types.