Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
IDispatch & default method
Hey there, I'm fairly new to COM/ActiveX etc, and I have a question which is probably quite easy. First off, I'm using Visual C++ and the app I am writing has a WebBrowser control embedded in a dialog box. What I want to do is suppress the right-click menu in the WebBrowser window, and I got as far as finding the "oncontextmenu" property of IHTMLElement2. Thing is, according to MSDN, the put_oncontextmenu() function needs to be passed a "VARIANT of type VT_DISPATCH that specifies the IDispatch interface of an object with a default method that is invoked when the event occurs."
All I want is to give put_oncontextmenu() a function which does nothing, but it wants all this IDispatch stuff which seems awfully complicated (I know it's necessary but it's a pain in C++). I know how to use VARIANT but I don't know anything about IDispatch, or how to pass put_oncontextmenu() an IDispatch which does nothing.
Any help appreciated!
0 · ·