I have a clean Win32 application (without MFC, etc.) to which I want to add a web browser control in a window. I know the basics of COM and can create a COM object for the browser using
hr = CoCreateInstance( CLSID_WebBrowser, NULL, CLSCTX_INPROC, IID_IWebBrowser2, (void**) &pWebBrowser);
However, apparently you need to call SetClientSite, passing IOleClientSite *. How to get such an interface? This example implements its own browser class, which provides an interface based on it and implementing it (here) . I tried to go this route, but in order to create an instance of the browser class, I would have to register it (no?). This seems terribly complicated - I just want to use an existing COM object, and not implement and register my own. What am I missing?
Assuming I'm implementing my own ClientSite class as part of my application, is it possible to not register it and just instantiate it by calling new ClientSite (and then QueryInterface interface using QueryInterface )? Will this work, or is it necessary to call CoCreateInstance ?
source share