|
-
Jun 3rd, 2023, 10:11 AM
#1
Fanatic Member
Re: vb6 edge webview2 demo by IUnknown,without rc6.dll
 Originally Posted by xiaoyao
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
 Originally Posted by xiaoyao
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] }"
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|