0

I have tried having the WebView2Loader.dll in the same directory as my executable. And I have also instead to tried to download the evergreen build from https://developer.microsoft.com/en-us/microsoft-edge/webview2/ and install it into my system (and have LoadLibrary find the DLL there instead)

In both cases the following happens. In my 32bit executable builds everything loads and works fine. In my 64bit executable my code:

Windows.LoadLibrary(PChar('WebView2Loader.dll'))

Gives this error:

%1 is not a valid Win32 application

I am on latest Windows 10 64bit

Any ideas what I can try...?

Tom
  • 3,587
  • 9
  • 69
  • 124
  • Presumably you have separate `.dll`:s for 32 and 64 bit. Do you adjust the `.dll` name accordingly (you show only one `LoadLibrary()` call) ? – Tom Brunberg Oct 30 '21 at 09:44
  • From reading support forums Microsoft state it is the same dll should work for both 32bit and 64bit.. (Maybe their DLL is 32bit?) And I can not find webview2 installer path when using evergreen, I have searched entire windows system... But also strange if evergreen would install non 64bit dll on my 64bit Windows. – Tom Oct 30 '21 at 09:45
  • Looking at the download page (your link) there are separate installers for x86, x64 and ARM64. – Tom Brunberg Oct 30 '21 at 09:55
  • @TomBrunberg I actually also tried the 64bit installer on Microsoft page. Can you let me know the exact paths on your system? – Tom Oct 30 '21 at 10:38
  • @TomBrunberg I know I must have webview2 installed because I have it in add/remove + 32bit application works when loading without the .dll in its directory, but I can not find any relevant .dll file anywhere. If you/anyone could give me examples of the physical names and addresses of the .dll files on your system I could try again (not easy to Google paths by the way.... Tried that) I guess next up must be to install something that watches file system during installation... But if anyone has any ideas... or Path examples, so I can manually search for and specify them for loadlibrary then.... – Tom Oct 30 '21 at 11:10
  • If you use the Microsoft installers, I don't think you need to know the actual paths. The `.dll` files will be installed in the normal `.dll` search paths. – Tom Brunberg Oct 30 '21 at 11:18
  • ...which is the whole point of _installing_ anything: to not take care oneself. Otherwise don't mix different architectures: either a DLL is for 32bit **or** 64bit (or 16bit), never multiple architectures. And those DLLs might import themselves DLLs, which should then be the same architecture (a 32bit DLL loading a 64bit DLL will also fail). – AmigoJack Oct 30 '21 at 12:00
  • @TomBrunberg Thank you for the paths. Unfortunately the Microsoft installer fails working properly with the 32/64bit issue, so I need to know paths to investigate the problem. – Tom Oct 30 '21 at 12:58
  • @AmigoJack I agree it is a complete mess that the Microsoft installer apparently only installs 32bit dll on my system and LoadLibrary tries to load that when called from my 64bit executable. (Personally I still release 32 and 64 versions of my own software. But definitely unacceptable only 32bit WebView2 dll is working properly) – Tom Oct 30 '21 at 12:59
  • @TomBrunberg I unfrotunately do not have any such path "C:\Program Files (x86)\product\product\product\" and searching for WebView2Loader.dll in "C:\Program Files (x86)\" fails :( ... and yes in Add/Remove WebView2 is listed as installed (and apparently works for 32bit executables) – Tom Oct 30 '21 at 13:03
  • @TomBrunberg I interpreted it as possible meaning 3rd party as relative to your own distribution of webview2 (i.e. possibly Microsoft) Anyhow then, my problem persist, I can not find any dlls of such name on my system even though searching my entire computer again and again including program files / program files (x86) folders. (Which is why I mentioned I had tried searching the root) I guess I will have to install something that watches my entire file system while installing the WebView2 evergreen distriubtion by Microsoft. Thank you for trying to help :) – Tom Oct 30 '21 at 13:38
  • For others reading this is useful https://stackoverflow.com/questions/59711826/chromium-edge-based-webview2-does-not-work ... seems the dll can also be called EmbeddedBrowserWebView.dll so now I can figure out what the evergreen package actually installed :) – Tom Oct 30 '21 at 14:06
  • I deleted most of my comments as they are of no value for other readers. I suggest you do the same. – Tom Brunberg Oct 30 '21 at 18:45

0 Answers0