Quote Originally Posted by xiaoyao View Post
Code:
virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_Source( 
            /* [retval][out] */ LPWSTR *uri) = 0;
out ,so you only put string or byte array here ,put strptr or varptr(buffer(0))

all this com object method,result is SOK=0
SO IF YOU WANT TO GET string or get object,Just pass the variable to return the data to the parameter

for example:get webview object
Code:
'For :webviewController->get_CoreWebView2(&webviewWindow);
r = DispCallByVtbl(webviewController, 23 + 2, VarPtr(webviewWindowPtr))
 Set webviewWindow = ObjFromPtr(VarPtr(webviewWindowPtr))
Code:
Function get_Source() As String
    Dim S As String, ID As Long
    S = String(500, " ")
    v = VTableCallEx("get_Source", webviewWindow, 2, VarPtr(S))
    If hResult <> 0 Then Exit Function
    ID = InStr(S, Chr(0))
    If ID > 0 Then S = Left(S, ID - 1)
    get_Source = S
End Function
thanks works perfect

Quote Originally Posted by xiaoyao View Post
Code:
Private Sub DoAddHostObjectToScript_Click()
MsgBox AddHostObjectToScript("Form1", Me)
End Sub
Private Sub doObjectTest_Click()

 ExecuteScript "const ObjForm1=window.chrome.webview.hostObjects.Form1;alert(ObjForm1.GetCaption)"
how to call host exe object by js?
it doesn't work
AddHostObjectToScript return True but Alert return "function() { [native code] }"