HMG with Edge WebView2

HMG Samples and Enhancements

Moderator: Rathinagiri

User avatar
luisvasquezcl
Posts: 1258
Joined: Thu Jul 31, 2008 3:23 am
Location: Chile
Contact:

Re: HMG with Edge WebView2

Post by luisvasquezcl »

Hola Claudio, como siempre sorprendiendonos con tus habilidades.
Te comento que la ùltima versiòn que liberaste funciona perfecto.
Gracias por tu aporte.
Saludos
User avatar
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

Post by AUGE_OHR »

hi,

i have run new Sample, after install Runtime Update, and WOW :D

than i try to build Sample.

Question : what Environment is need :?:

while i still work with c:\hmg.3.4.4 i have change it in build_cpp.bat

Code: Select all

 SET HMGPATH=c:\hmg.3.4.4
so when start build_test_webview2.bat i got a lot of Error and no EXE are build :(
Harbour 3.2.0dev (r1703241902)
Copyright (c) 1999-2016, http://harbour-project.org/
In file included from test_webview2.prg:71:0:
C:/hmg.3.4.4/0/hmg_webview2/WebView2/include/WebView2.h:19:0: warning: ignoring #pragma warning [-Wunknown-pragmas]
#pragma warning( disable: 4049 ) /* more than 64k source lines */
^
test_webview2.prg:153:1: warning: identifier 'nullptr' is a keyword in C++11 [-Wc++0x-compat]
test_webview2.prg:89:43: warning: defaulted and deleted functions only available with -std=c++11 or -std=gnu++11
test_webview2.prg:90:32: error: expected ',' or '...' before '&&' token
test_webview2.prg:90:38: warning: defaulted and deleted functions only available with -std=c++11 or -std=gnu++11
test_webview2.prg:90:38: error: invalid constructor; you probably meant 'EventHandler (const EventHandler&)'
test_webview2.prg:91:54: warning: defaulted and deleted functions only available with -std=c++11 or -std=gnu++11
test_webview2.prg:92:43: error: expected ',' or '...' before '&&' token
test_webview2.prg:92:49: warning: defaulted and deleted functions only available with -std=c++11 or -std=gnu++11
test_webview2.prg:94:12: error: 'function' in namespace 'std' does not name a template type
test_webview2.prg:95:12: error: 'function' in namespace 'std' does not name a template type
test_webview2.prg: In function 'HRESULT EventInterfaces_EnvironmentCompleted_Invoke(ICoreWebView2CreateCoreWebView2EnvironmentCompletedHandler*, HRESULT, ICoreWebView2Environment*)':
test_webview2.prg:119:45: error: 'class EventHandler' has no member named 'EnvironmentCompleted'
test_webview2.prg: In function 'HRESULT EventInterfaces_ControllerCompleted_Invoke(ICoreWebView2CreateCoreWebView2ControllerCompletedHandler*, HRESULT, ICoreWebView2Controller*)':
test_webview2.prg:132:45: error: 'class EventHandler' has no member named 'ControllerCompleted'
test_webview2.prg: In constructor 'EventHandler::EventHandler()':
test_webview2.prg:143:63: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
test_webview2.prg:144:63: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
test_webview2.prg: At global scope:
test_webview2.prg:147:33: warning: defaulted and deleted functions only available with -std=c++11 or -std=gnu++11
test_webview2.prg:153:27: error: 'nullptr' was not declared in this scope
test_webview2.prg:154:39: error: 'nullptr' was not declared in this scope
test_webview2.prg:155:21: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
test_webview2.prg:155:22: error: in C++98 'handler' must be initialized by constructor, not by '{...}'
test_webview2.prg: In function 'void GetDataPath(LPTSTR, DWORD)':
test_webview2.prg:172:22: error: 'nullptr' was not declared in this scope
test_webview2.prg: In function 'void FatalError(LPCTSTR, ...)':
test_webview2.prg:187:15: error: 'nullptr' was not declared in this scope
test_webview2.prg: In function 'void runWebView2()':
test_webview2.prg:237:12: error: 'class EventHandler' has no member named 'EnvironmentCompleted'
test_webview2.prg:238:12: error: 'class EventHandler' has no member named 'ControllerCompleted'
test_webview2.prg:244:20: error: 'nullptr' was not declared in this scope
test_webview2.prg: In function 'void HB_FUN_EXECUTESCRIPT_WEBVIEW2()':
test_webview2.prg:316:60: error: 'nullptr' was not declared in this scope
test_webview2.prg: In function 'void HB_FUN_GETVERSION_WEBVIEW2()':
test_webview2.prg:322:16: warning: deprecated conversion from string constant to 'WCHAR* {aka wchar_t*}' [-Wwrite-strings]
test_webview2.prg: In instantiation of 'HRESULT Null_QueryInterface(T*, const IID&, void**) [with T = ICoreWebView2CreateCoreWebView2EnvironmentCompletedHandler; HRESULT = long int; IID = _GUID]':
test_webview2.prg:127:1: required from here
test_webview2.prg:102:57: warning: unused parameter 'This' [-Wunused-parameter]
test_webview2.prg:102:70: warning: unused parameter 'riid' [-Wunused-parameter]
test_webview2.prg:102: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:127:1: required from here
test_webview2.prg:107: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:127:1: required from here
test_webview2.prg:112: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:140:1: required from here
test_webview2.prg:102:57: warning: unused parameter 'This' [-Wunused-parameter]
test_webview2.prg:102:70: warning: unused parameter 'riid' [-Wunused-parameter]
test_webview2.prg:102: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:140:1: required from here
test_webview2.prg:107: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:140:1: required from here
test_webview2.prg:112:48: warning: unused parameter 'This' [-Wunused-parameter]
hbmk2: Error: Running C/C++ compiler. 1
g++.exe -c -O3 -march=i586 -mtune=pentiumpro -fomit-frame-pointer -W -Wall -pipe -Ic:/hmg.3.4.4/harbour/include -IC:/hmg.3.4.4/0/hmg_webview2 -Ic:/hmg.3.4.4/include -IC:/hmg.3.4.4/0/hmg_webview2/WebView2/include R:/Temp/hbmk_vt83p7.dir/test_webview2.c R:/Temp/hbmk_7rpc1n.c
have fun
Jimmy
User avatar
srvet_claudio
Posts: 2193
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: HMG with Edge WebView2

Post by srvet_claudio »

Hi Jimmy,
the example is created to use the compiler version of mingw that comes with hmg.3.5
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
User avatar
Claudio Ricardo
Posts: 367
Joined: Tue Oct 27, 2020 3:38 am
DBs Used: DBF, MySQL, MariaDB
Location: Bs. As. - Argentina

Re: HMG with Edge WebView2

Post by Claudio Ricardo »

Hola Claudio... Se ve genial !!!
Para probarlo tendré que crear una nueva VirtualBox machine con W10 y HMG 3.5 ?
o instalando HMG 3.5 para compilar y solo instalando Edge en W7 se podrá ejecutar ?
Aclaro: Uso Linux y en VirtualBox W7 HP x64 SP1 para programar y aún sigo con HMG 3.4.4
Corrige al sabio y lo harás más sabio, Corrige al necio y lo harás tu enemigo.
WhatsApp / Telegram: +54 911-63016162
User avatar
srvet_claudio
Posts: 2193
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: HMG with Edge WebView2

Post by srvet_claudio »

Hola Claudio,
Tenes que instalar hmg.3.5 y solo el runtime webview2 de este enlace:
https://go.microsoft.com/fwlink/p/?LinkId=2124703

No necesitas instalar el navegador Edge.
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
User avatar
Claudio Ricardo
Posts: 367
Joined: Tue Oct 27, 2020 3:38 am
DBs Used: DBF, MySQL, MariaDB
Location: Bs. As. - Argentina

Re: HMG with Edge WebView2

Post by Claudio Ricardo »

Ohhh buenisimo !!! sólo espero que al instalar HMG 3.5 no me haga conflicto con la versión anterior que tengo, y puedan convivir
juntas, ya que estoy desarrollando un programa grande en este momento y no quiero arriesgar.
Corrige al sabio y lo harás más sabio, Corrige al necio y lo harás tu enemigo.
WhatsApp / Telegram: +54 911-63016162
User avatar
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

Post by AUGE_OHR »

hi Claudio,
srvet_claudio wrote: Wed Aug 18, 2021 2:03 pm the example is created to use the compiler version of mingw that comes with hmg.3.5
YES ... now i can compile / link Sample :D

have test it under Windows 11 (Insider) Version 10.0.22000.132
HMG35_WebView2.jpg
HMG35_WebView2.jpg (86.36 KiB) Viewed 2259 times
p.s. i wrote this "in" HMG_Webview2
have fun
Jimmy
User avatar
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

Post by AUGE_OHR »

hi,

i have play with HMG_Webview2 and add TEXTBOX to input URL
webview2_TEXTBOX.zip
(4.5 KiB) Downloaded 160 times
! Note : i have extract "C"-Code which are in HB_FUNC.PRG now
my CLICK will not try to "format" "C"-Code in HB_FUNC.PRG

now i want to learn "more" what i can do with Webview2 ...

---

some Question :

as i need "full"-String like "http://www.hmgforum.com" i check for "http" or "https"

Code: Select all

PROCEDURE DoNavigate()
LOCAL cNewURL :=  GetProperty( "Win_1", "Text_Navigate","VALUE")

   IF .NOT. "http://" $ LOWER(cNewURL) .OR. .NOT. "https://" $ LOWER(cNewURL)
      cNewURL := "https://" + cNewURL
   ENDIF

   SbarText(cNewURL) // Statusbar only in Fullscreen ?
   NAVIGATE_WEBVIEW2( cNewURL )
Return
now i use "https" ...

---

i can use Mouse-"Navigation"-Button to goto "last" or "next" Website

how can i get "active" URL to show it in Statusbar :?:

---

to check Input Webview2 use "local" Language. how can i set it to "English" :?:

---

Webview2 start with 100 % ... i like to change it to 120 % , how :?:

---

i have to use build_test_webview2.bat
can somebody please help me to build a *.HBP / *.HBC so i can use HMG35 IDE. thx
have fun
Jimmy
User avatar
mol
Posts: 3723
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: HMG with Edge WebView2

Post by mol »

I have a problem:

Code: Select all


hbmk2: Error: Referenced, missing, but unknown function(s):
       NAVIGATE_WEBVIEW2(), EXECUTESCRIPT_WEBVIEW2(), GETVERSION_WEBVIEW2(),
       INIT_WEBVIEW2(), RESIZE_WEBVIEW2()
       
how can I solve it?
User avatar
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

Post by AUGE_OHR »

hi Mol,
mol wrote: Thu Aug 19, 2021 1:42 pm how can I solve it?
do you use my modify Version with TEXTBOX for URL Input :?:

if Yes : as i wrote i have "split" "C"-Code into HB_FUNC.PRG
than you need my modify build_test_webview2.bat

Code: Select all

call build_cpp.bat  test_webview2.prg HB_FUNC.PRG -L./WebView2/Win32 -lWebView2Loader -I./WebView2/include
have fun
Jimmy
Post Reply