IE

Natter
Posts: 1244
Joined: Mon May 14, 2007 9:49 am

Re: IE

Post by Natter »

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"))
User avatar
Antonio Linares
Site Admin
Posts: 42597
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 40 times
Been thanked: 86 times
Contact:

Re: IE

Post by Antonio Linares »

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: 42597
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 40 times
Been thanked: 86 times
Contact:

Re: IE

Post by Antonio Linares »

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: 42597
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 40 times
Been thanked: 86 times
Contact:

Re: IE

Post by Antonio Linares »

Solved :-)

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

Antonio Linares
www.fivetechsoft.com
Natter
Posts: 1244
Joined: Mon May 14, 2007 9:49 am

Re: IE

Post by Natter »

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


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
 
User avatar
Antonio Linares
Site Admin
Posts: 42597
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 40 times
Been thanked: 86 times
Contact:

Re: IE

Post by Antonio Linares »

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
Natter
Posts: 1244
Joined: Mon May 14, 2007 9:49 am

Re: IE

Post by Natter »

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 )
User avatar
Antonio Linares
Site Admin
Posts: 42597
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 40 times
Been thanked: 86 times
Contact:

Re: IE

Post by Antonio Linares »

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
Natter
Posts: 1244
Joined: Mon May 14, 2007 9:49 am

Re: IE

Post by Natter »

Is it possible to install webview 2 runtime under Linux ?
User avatar
Antonio Linares
Site Admin
Posts: 42597
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 40 times
Been thanked: 86 times
Contact:

Re: IE

Post by Antonio Linares »

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
Post Reply