While BHO extensions allow JavaScript to call functions in a C++ BHO, I am exploring a different scenario. Imagine that instead of using a BHO, I have a C++ console application that creates an IE COM object like this:
HRESULT hr = CoCreateInstance(
CLSID_InternetExplorer,
NULL,
CLSCTX_LOCAL_SERVER,
IID_IWebBrowser2,
(void**)&_cBrowser);
In addition to this setup, I also have a class that "owns" the IWebBrowser2 object returned by the function:
class BrowserWrapper{
public:
CComPtr<IWebBrowser2> pBrowser;
void SomeFunction(...)
}
My question is: Is there a way to call a function like "SomeFunction" in the wrapper class from the JavaScript within the spawned IWebBrowser2 object?