thqby / ahk2_lib

MIT License
197 stars 26 forks source link

[WebView2] New version of library gives error when compiled #49

Closed tomkahn closed 4 months ago

tomkahn commented 4 months ago

Here is a simple example I took from somewhere on the forum.

The code works fine as long as you just run the .ahk file directly.

After compiling the .ahk file into an .exe I get this error:

image

It also works fine if you use an older version of your library (1.0.26 from 2022/01/16 as opposed to 1.0.31 from 2023/11/20). I put the older one for comparison into the lib_old folder as well.

I'm using AHK v.2.0.11 U64.

I stumbled across this issue when compiling a bigger project of mine that uses your library. In this case the WebView library doesn't produce an error but simply never loads any website. The older version of the library works fine.

thqby commented 4 months ago

I don't think the old version can run properly after compilation, because the default path of the dll has changed after compilation. You need to place the dll file in the root directory of the exe or specify the corresponding dll path in the code.

tomkahn commented 4 months ago

Thank you, very helpful. It seems like we fixed this issue in the old version before and that's why it was working.