HMG with Edge WebView2
Moderator: Rathinagiri
- srvet_claudio
- Posts: 2193
- Joined: Thu Feb 25, 2010 8:43 pm
- Location: Uruguay
- Contact:
HMG with Edge WebView2
Hi,
After much trial and error, and fight a little with the parameters of hbmk2 I managed to create a demo of HMG with Edge WebView2.
It is not much information on Edge WebView2 compiled with GCC/MinGW on the Internet maybe because most people use Visual Studio to build WebView2 applications. Most of the samples use MSVC ++ and a few of Microsoft's own compiler C++ classes.
I hope you enjoy!
After much trial and error, and fight a little with the parameters of hbmk2 I managed to create a demo of HMG with Edge WebView2.
It is not much information on Edge WebView2 compiled with GCC/MinGW on the Internet maybe because most people use Visual Studio to build WebView2 applications. Most of the samples use MSVC ++ and a few of Microsoft's own compiler C++ classes.
I hope you enjoy!
- Attachments
-
- hmg_webview2.zip
- (2.07 MiB) Downloaded 255 times
- AUGE_OHR
- Posts: 2064
- Joined: Sun Aug 25, 2019 3:12 pm
- DBs Used: DBF, PostgreSQL, MySQL, SQLite
- Location: Hamburg, Germany
Re: HMG with Edge WebView2
hi,
try to run Sample and got Error Windows Version 10.0.19044.1165
Microsoft Edge Version 92.0.902.73 (Offizielles Build) (32-Bit)
try to run Sample and got Error Windows Version 10.0.19044.1165
Microsoft Edge Version 92.0.902.73 (Offizielles Build) (32-Bit)
have fun
Jimmy
Jimmy
Re: HMG with Edge WebView2
Hola Dr. Soto, Saludos...
Igual conmigo !
Windows 10 Pro 21H1 19043.1165
Microsoft Edge Versión 92.0.902.73 (Compilación oficial) (64 bits)
Al compilarlo, despliega esto:
G:\AGL\Desarrollos\Pruebas\hmg_webview2>call build_cpp.bat test_webview2.prg -L./WebView2/Win32 -lWebView2Loader -I./WebView2/include
Harbour 3.2.0dev (r2011030937)
Copyright (c) 1999-2020, https://harbour.github.io/
In file included from test_webview2.prg:51:
G:/AGL/Desarrollos/Pruebas/hmg_webview2/WebView2/include/WebView2.h:19: warning: ignoring #pragma warning [-Wunknown-pragmas]
19 | #pragma warning( disable: 4049 ) /* more than 64k source lines */
|
test_webview2.prg: In instantiation of 'HRESULT Null_QueryInterface(T*, const IID&, void**) [with T = ICoreWebView2CreateCoreWebView2EnvironmentCompletedHandler; HRESULT = long int; IID = _GUID]':
test_webview2.prg:107:1: required from here
test_webview2.prg:82:57: warning: unused parameter 'This' [-Wunused-parameter]
test_webview2.prg:82:70: warning: unused parameter 'riid' [-Wunused-parameter]
test_webview2.prg:82:83: warning: unused parameter 'ppvObject' [-Wunused-parameter]
test_webview2.prg: In instantiation of 'ULONG Null_AddRef(T*) [with T = ICoreWebView2CreateCoreWebView2EnvironmentCompletedHandler; ULONG = long unsigned int]':
test_webview2.prg:107:1: required from here
test_webview2.prg:87:47: warning: unused parameter 'This' [-Wunused-parameter]
test_webview2.prg: In instantiation of 'ULONG Null_Release(T*) [with T = ICoreWebView2CreateCoreWebView2EnvironmentCompletedHandler; ULONG = long unsigned int]':
test_webview2.prg:107:1: required from here
test_webview2.prg:92:48: warning: unused parameter 'This' [-Wunused-parameter]
test_webview2.prg: In instantiation of 'HRESULT Null_QueryInterface(T*, const IID&, void**) [with T = ICoreWebView2CreateCoreWebView2ControllerCompletedHandler; HRESULT = long int; IID = _GUID]':
test_webview2.prg:120:1: required from here
test_webview2.prg:82:57: warning: unused parameter 'This' [-Wunused-parameter]
test_webview2.prg:82:70: warning: unused parameter 'riid' [-Wunused-parameter]
test_webview2.prg:82:83: warning: unused parameter 'ppvObject' [-Wunused-parameter]
test_webview2.prg: In instantiation of 'ULONG Null_AddRef(T*) [with T = ICoreWebView2CreateCoreWebView2ControllerCompletedHandler; ULONG = long unsigned int]':
test_webview2.prg:120:1: required from here
test_webview2.prg:87:47: warning: unused parameter 'This' [-Wunused-parameter]
test_webview2.prg: In instantiation of 'ULONG Null_Release(T*) [with T = ICoreWebView2CreateCoreWebView2ControllerCompletedHandler; ULONG = long unsigned int]':
test_webview2.prg:120:1: required from here
test_webview2.prg:92:48: warning: unused parameter 'This' [-Wunused-parameter]
g:/agl/hmg/3.5/mingw/bin/../lib/gcc/i686-w64-mingw32/9.3.0/../../../../i686-w64-mingw32/bin/ld.exe: warning: resolving _CreateCoreWebView2EnvironmentWithOptions@16 by linking to _CreateCoreWebView2EnvironmentWithOptions
Use --enable-stdcall-fixup to disable these warnings
Use --disable-stdcall-fixup to disable these fixups
Andrés González López
Desde Guadalajara, Jalisco. México.
Desde Guadalajara, Jalisco. México.
- srvet_claudio
- Posts: 2193
- Joined: Thu Feb 25, 2010 8:43 pm
- Location: Uruguay
- Contact:
Re: HMG with Edge WebView2
Hi,
1) My .exe not work?
2) Try change this line in C code:
HRESULT result = CreateCoreWebView2EnvironmentWithOptions( nullptr, TStrToWStr(szDataPath).c_str(), nullptr, &handler );
For this line:
HRESULT result = CreateCoreWebView2EnvironmentWithOptions( nullptr, nullptr, nullptr, &handler );
1) My .exe not work?
2) Try change this line in C code:
HRESULT result = CreateCoreWebView2EnvironmentWithOptions( nullptr, TStrToWStr(szDataPath).c_str(), nullptr, &handler );
For this line:
HRESULT result = CreateCoreWebView2EnvironmentWithOptions( nullptr, nullptr, nullptr, &handler );
Re: HMG with Edge WebView2
srvet_claudio wrote: ↑Tue Aug 17, 2021 4:05 am Hi,
1) My .exe not work?
Así como viene el .exe que envió despliega lo siguiente. 2) Try change this line in C code:
HRESULT result = CreateCoreWebView2EnvironmentWithOptions( nullptr, TStrToWStr(szDataPath).c_str(), nullptr, &handler );
For this line:
HRESULT result = CreateCoreWebView2EnvironmentWithOptions( nullptr, nullptr, nullptr, &handler );
Resulta el mismo mensaje al volverlo a compilar ya modificado...
Andrés González López
Desde Guadalajara, Jalisco. México.
Desde Guadalajara, Jalisco. México.
- srvet_claudio
- Posts: 2193
- Joined: Thu Feb 25, 2010 8:43 pm
- Location: Uruguay
- Contact:
Re: HMG with Edge WebView2
There is not much information on webview2 with c ++ and the error answers are very ambiguous in many cases. Please compile this new file to see if we can better capture the error that occurred.
- Attachments
-
- new prg test_webview2.zip
- (3 KiB) Downloaded 172 times
Re: HMG with Edge WebView2
srvet_claudio wrote: ↑Tue Aug 17, 2021 5:59 pm There is not much information on webview2 with c ++ and the error answers are very ambiguous in many cases. Please compile this new file to see if we can better capture the error that occurred.
Aquí va Dr. Soto...
..
Code: Select all
G:\AGL\Desarrollos\Pruebas\hmg_webview2>call build_cpp.bat test_webview2.prg -L./WebView2/Win32 -lWebView2Loader -I./WebView2/include
Harbour 3.2.0dev (r2011030937)
Copyright (c) 1999-2020, https://harbour.github.io/
In file included from test_webview2.prg:54:
G:/AGL/Desarrollos/Pruebas/hmg_webview2/WebView2/include/WebView2.h:19: warning: ignoring #pragma warning [-Wunknown-pragmas]
19 | #pragma warning( disable: 4049 ) /* more than 64k source lines */
|
test_webview2.prg: In instantiation of 'HRESULT Null_QueryInterface(T*, const IID&, void**) [with T = ICoreWebView2CreateCoreWebView2EnvironmentCompletedHandler; HRESULT = long int; IID = _GUID]':
test_webview2.prg:110:1: required from here
test_webview2.prg:85:57: warning: unused parameter 'This' [-Wunused-parameter]
test_webview2.prg:85:70: warning: unused parameter 'riid' [-Wunused-parameter]
test_webview2.prg:85:83: warning: unused parameter 'ppvObject' [-Wunused-parameter]
test_webview2.prg: In instantiation of 'ULONG Null_AddRef(T*) [with T = ICoreWebView2CreateCoreWebView2EnvironmentCompletedHandler; ULONG = long unsigned int]':
test_webview2.prg:110:1: required from here
test_webview2.prg:90:47: warning: unused parameter 'This' [-Wunused-parameter]
test_webview2.prg: In instantiation of 'ULONG Null_Release(T*) [with T = ICoreWebView2CreateCoreWebView2EnvironmentCompletedHandler; ULONG = long unsigned int]':
test_webview2.prg:110:1: required from here
test_webview2.prg:95:48: warning: unused parameter 'This' [-Wunused-parameter]
test_webview2.prg: In instantiation of 'HRESULT Null_QueryInterface(T*, const IID&, void**) [with T = ICoreWebView2CreateCoreWebView2ControllerCompletedHandler; HRESULT = long int; IID = _GUID]':
test_webview2.prg:123:1: required from here
test_webview2.prg:85:57: warning: unused parameter 'This' [-Wunused-parameter]
test_webview2.prg:85:70: warning: unused parameter 'riid' [-Wunused-parameter]
test_webview2.prg:85:83: warning: unused parameter 'ppvObject' [-Wunused-parameter]
test_webview2.prg: In instantiation of 'ULONG Null_AddRef(T*) [with T = ICoreWebView2CreateCoreWebView2ControllerCompletedHandler; ULONG = long unsigned int]':
test_webview2.prg:123:1: required from here
test_webview2.prg:90:47: warning: unused parameter 'This' [-Wunused-parameter]
test_webview2.prg: In instantiation of 'ULONG Null_Release(T*) [with T = ICoreWebView2CreateCoreWebView2ControllerCompletedHandler; ULONG = long unsigned int]':
test_webview2.prg:123:1: required from here
test_webview2.prg:95:48: warning: unused parameter 'This' [-Wunused-parameter]
g:/agl/hmg/3.5/mingw/bin/../lib/gcc/i686-w64-mingw32/9.3.0/../../../../i686-w64-mingw32/bin/ld.exe: warning: resolving _CreateCoreWebView2EnvironmentWithOptions@16 by linking to _CreateCoreWebView2EnvironmentWithOptions
Use --enable-stdcall-fixup to disable these warnings
Use --disable-stdcall-fixup to disable these fixups
Andrés González López
Desde Guadalajara, Jalisco. México.
Desde Guadalajara, Jalisco. México.
- srvet_claudio
- Posts: 2193
- Joined: Thu Feb 25, 2010 8:43 pm
- Location: Uruguay
- Contact:
Re: HMG with Edge WebView2
Hi Andres,
The information on the internet is scarce, but the problem seems to be with the runtime version you have of webview2, please update your runtime version from this Microsoft link:
https://go.microsoft.com/fwlink/p/?LinkId=2124703
The information on the internet is scarce, but the problem seems to be with the runtime version you have of webview2, please update your runtime version from this Microsoft link:
https://go.microsoft.com/fwlink/p/?LinkId=2124703
Re: HMG with Edge WebView2
srvet_claudio wrote: ↑Tue Aug 17, 2021 10:42 pm Hi Andres,
The information on the internet is scarce, but the problem seems to be with the runtime version you have of webview2, please update your runtime version from this Microsoft link:
https://go.microsoft.com/fwlink/p/?LinkId=2124703
Solucionado Dr. Soto, muchas gracias por su ejemplo y ayuda !
Andrés González López
Desde Guadalajara, Jalisco. México.
Desde Guadalajara, Jalisco. México.
- srvet_claudio
- Posts: 2193
- Joined: Thu Feb 25, 2010 8:43 pm
- Location: Uruguay
- Contact:
Re: HMG with Edge WebView2
Hi,
this is a slightly improved version with more information to detect and solve errors in webview2 runtime.
this is a slightly improved version with more information to detect and solve errors in webview2 runtime.
- Attachments
-
- hmg_webview2_version02.zip
- (2.08 MiB) Downloaded 274 times