Closed akselfoley closed 1 year ago
It may be caused by the system environment.
I've checked on both computers I am testing.
The errors above is from the a computer running .ahk.
But I've also created an .exe to run together with \lib*
So get a new error there:
▶ 072: If (R := DllCall(dllPath '\CreateCoreWebView2EnvironmentWithOptions', 'str', edgeruntime, 'str', datadir || RegExReplace(A_AppData, 'Roaming$', 'Local\Microsoft\Edge\User Data'), 'ptr', options, 'ptr', EnvironmentCompletedHandler, 'uint'))
Installation status is the same for both:
Keep the default file tree structure, and #Include <WebView2\WebView2>
.
Or specify the corresponding version of WebView2Loader.dll.
Can you provide the best structure? :)
This is my current structure:
The above directory should not have this error. My directory is consistent with this repository.
How does it know to use D:\Documents\Autohotkey\Lib to look for <Webview2\Webview2> ?
https://www.autohotkey.com/docs/v2/Scripts.htm#lib
This is User library.
But for this to work it should be enough to have:
Where the webview2 folder looks like this:
I will create an .exe from the .ahk, and run it on a computer that dont have AHK installed.
Any suggestions?
Library location priority order, Local library > User library > Standard library.
After the script is compiled, A_LineFile
will change and need to be adjusted according to the actual situation.
I am very sorry. I am a bit stupid at the moment.
Local Library in this case is the folder WebView2 that's next to .ahk/.exe and it would work to type <WebView2\WebView2> ?
yes
.ahk/../lib Local library .exe/../lib Standard library
So I tried to do the User Library, and it found the files. Still the same error:
View the value of the function hresult
parameter, and throw OSError(hresult)
display error description
I don't understand. Sorry.
But I updated the code of WebView2.ahk.
What is the Edge Webview2 Runtime version?
My current version is 111.0.1661.51
I have the same version installed.
I guess I’ll have to walk away from this and keep the current ahi that opens a url in Edge kiosk mode.
Thanks for trying :)
So WebView2.ahk gives me these errors:
Error: Parameter #1 of ObjAddRef is invalid.
▶ 060: DllCall('user32\GetClientRect', 'ptr', hwnd, 'ptr', RECT := Buffer(16)), ObjAddRef(createdController)
Error: Parameter #2 of ComCall is invalid.
▶ 169: Return A_PtrSize = 8 ? ComCall(6, this, 'ptr', Value) : ComCall(6, this, 'int64', NumGet(Value, 'int64'), 'int64', NumGet(Value, 8, 'int64'))
This version: /****
The code:
Requires AutoHotKey v2.0-
Include lib\WebView2.ahk
main := Gui() main.Show(Format('w{} h{}', A_ScreenWidth 0.6, A_ScreenHeight 0.6)) main.Show()
wvc := WebView2.create(main.hwnd) wv := wvc.CoreWebView2 wv.Navigate("https://www.vg.no")