I've recently inherited a project that creates and implements a COM coclass/interface in a DLL. This COM DLL is utilized by an application which applies a GUI to the COM class's interface. This is the only application that uses the COM DLL. I'm new to dealing with COM and good documentation is hard to find.
Part of my task involves adding some methods/properties (as well as removing some that are no longer needed) to the interface. I've learned that I need to modify the IDL to accomplish this. Right now I have simply added my new methods and properties to the end of the interface and things seem to be working good. However when I remove one of the properties (for example) things go bad quickly when I run the application.
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);
}
I'm guessing it has to do with the broken up ID number sequence. I suppose I could shift everything under it up and things would work. But I'm curious on the proper method for doing all of this.
Much thanks.
IDispatch::Invoke
is used in late binding, which I'm not using. – Frank Weindel