
Originally Posted by
yokesee
works fine, only out of 10 times 2 closed when CreateWebView was called.
One question, how do you look for the functions and the index?
Code:
r = DispCallByVtbl(webviewWindow, 3 + 2, StrPtr(Url))
ii fix it,now it's all right.you can download new version t try.
com VTable like this,first is (QueryInterface+AddRef+Invoke)
so Invoke VTable(3) address if 3*4=12
here we use 3,DispCallByVtbl will put index=3*4
Code:
.VTable(0) = GetAddress(AddressOf QueryInterface)
.VTable(1) = GetAddress(AddressOf AddRef)
.VTable(2) = GetAddress(AddressOf Release)
.VTable(3) = GetAddress(AddressOf Invoke)
Navigate is the 3rd method, plus IUnknown has 3 methods by default,
which is actually 3+3-1
This is the offset, and the first QueryInterface must be 0.
So the 6th is actually offset = 5*4
Code:
webview2.h:
ICoreWebView2 : public IUnknown
{
public:
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_Settings(
/* [retval][out] */ ICoreWebView2Settings **settings) = 0;
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_Source(
/* [retval][out] */ LPWSTR *uri) = 0;
virtual HRESULT STDMETHODCALLTYPE Navigate(
More of the following operations are for this ICoreWebView2 object:
AddScriptToExecuteOnDocumentCreated
ExecuteScript
CallDevToolsProtocolMethod
GoBack,GoForward
Stop
get_DocumentTitle
AddHostObjectToScript (like put form1 to js)
OpenDevToolsWindow