I have an ActiveX control written in C++ using ATL that has a couple of unsafe methods (reading and writing files.)
I’ve looked at the IObjectSafety interface but it is not clear if I can protect individual methods or not. Since the control is mostly used via the IDispatch interface, I do not wish to mark the whole interface as unsafe.
Is there a good tutorial on the interface and how it is used by InternetExplorer?
IObjectSafetymarks interfaces, not individual methods. If you look at its syntax, you will see that the arguments do not provide flexibility to mark individual methods.See also: How To IObjectSafety Marks ATL Controls Safe for Initializing.