IE

Re: IE

Postby Natter » Sat Jun 04, 2022 10:32 am

Antonio, excuse me, I sent you an html file by email.

hb_DynCall( { "webview_navigate", pLib, ;
hb_bitOr( HB_DYN_CTYPE_VOID, hb_SysCallConv() ),;
HB_DYN_CTYPE_VOID_PTR, HB_DYN_CTYPE_CHAR_PTR },;
hWebView, "data:text/html,"+CRLF+filestr("my.html"))
Natter
 
Posts: 1203
Joined: Mon May 14, 2007 9:49 am

Re: IE

Postby Antonio Linares » Sat Jun 04, 2022 11:21 pm

Dear Yuri,

If you upload your HTML file to your hosting server and then use webview to navigate to it, it works fine. I just tested it.

But if we try to load it reading the file, then it crashes. Not sure why. We have noticed that with other HTML files too and still we
are wondering why.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42059
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: IE

Postby Antonio Linares » Sat Jun 04, 2022 11:23 pm

In webview docs we find this:

// Navigates webview to the given URL. URL may be a properly encoded data URI.
// Examples:
// webview_navigate(w, "https://github.com/webview/webview");
// webview_navigate(w, "data:text/html,%3Ch1%3EHello%3C%2Fh1%3E");
// webview_navigate(w, "data:text/html;base64,PGgxPkhlbGxvPC9oMT4=");


Please notice that the HTML contents seems to be encoded. Maybe thats required.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42059
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: IE

Postby Antonio Linares » Sat Jun 04, 2022 11:34 pm

Solved :-)

oWebView:Navigate( "data:text/html;base64," + hb_base64Encode( hb_memoRead( "my.html" ) ) )
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42059
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: IE

Postby Natter » Sun Jun 05, 2022 8:28 am

Antonio, thank you, the html file is loading normally. Only in webview, map rendering is much slower than in IE.

I tried to embed a webview object in a window. According to the documentation, the second webview_create parameter should be replaced with the window handle. However, it didn't work :(

Code: Select all  Expand view

function Main()
private pLib := hb_LibLoad( "webview.dll" )
private oWnd

   DEFINE DIALOG oWnd TITLE "FWH desktop app" SIZE 1000, 600

   ACTIVATE DIALOG oWnd  ON INIT CreateWebView() CENTER

   hb_LibFree( pLib )
return NIL

function CreateWebView
local hWebView

   hWebView := hb_DynCall( { "webview_create", pLib, ;
                 hb_bitOr( HB_DYN_CTYPE_VOID_PTR, hb_SysCallConv() ), ;
                 HB_DYN_CTYPE_VOID_PTR, hb_SysLong(), HB_DYN_CTYPE_VOID_PTR }, ;
                 oWnd:hWnd, 0)

   hb_DynCall( { "webview_navigate", pLib, ;
                 hb_bitOr( HB_DYN_CTYPE_VOID, hb_SysCallConv() ),;
                 HB_DYN_CTYPE_VOID_PTR, HB_DYN_CTYPE_CHAR_PTR },;
                 hWebView, "data:text/html;base64,"+ ;
                 hb_base64Encode(hb_memoread("my.html")))

   hb_DynCall( { "webview_run", pLib, ;
                 hb_bitOr( HB_DYN_CTYPE_VOID, hb_SysCallConv() ), ;
                 HB_DYN_CTYPE_VOID, HB_DYN_CTYPE_VOID_PTR }, hWebView )
return nil
 
Natter
 
Posts: 1203
Joined: Mon May 14, 2007 9:49 am

Re: IE

Postby Antonio Linares » Mon Jun 06, 2022 6:21 am

You have to supply 0, 0 to WebView_Create(). It does not work using params there

But you can make it child of any other window using SetParent( webview_get_window( hWebView ), hWndParent )
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42059
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: IE

Postby Natter » Mon Jun 06, 2022 11:33 am

Harbour doesn't understand this syntax:
webview_get_window( hWebView )

I tried to read the window handle, but I get empty.

hWebView := hb_DynCall( { "webview_create", pLib, ;
hb_bitOr( HB_DYN_CTYPE_VOID_PTR, hb_SysCallConv() ), ;
HB_DYN_CTYPE_VOID_PTR, hb_SysLong(), HB_DYN_CTYPE_VOID_PTR }, 0, 0)

hWb:=hb_DynCall( { "webview_get_window", pLib, ;
hb_bitOr( HB_DYN_CTYPE_VOID, hb_SysCallConv() ), ;
HB_DYN_CTYPE_VOID, HB_DYN_CTYPE_VOID_PTR }, hWebView )
Natter
 
Posts: 1203
Joined: Mon May 14, 2007 9:49 am

Re: IE

Postby Antonio Linares » Mon Jun 06, 2022 6:46 pm

Dear Yuri,

You need the new Class TWebView. It properly works with Borland, Microsoft, MinGW and xHarbour too

Its going to be available in a few days with the new FWH 22.06 version
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42059
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: IE

Postby Natter » Tue Jun 07, 2022 3:55 am

Is it possible to install webview 2 runtime under Linux ?
Natter
 
Posts: 1203
Joined: Mon May 14, 2007 9:49 am

Re: IE

Postby Antonio Linares » Tue Jun 07, 2022 5:16 am

From https://github.com/webview/webview:

It uses Cocoa/WebKit on macOS, gtk-webkit2 on Linux and Edge on Windows 10.


So it seems as it also works on Linux. I haven't tried it on Linux yet
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42059
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Otto and 78 guests