IE
Re: IE
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"))
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"))
- 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
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.
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.
- 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
In webview docs we find this:
Please notice that the HTML contents seems to be encoded. Maybe thats required.
// 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.
- 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
Solved 
oWebView:Navigate( "data:text/html;base64," + hb_base64Encode( hb_memoRead( "my.html" ) ) )

oWebView:Navigate( "data:text/html;base64," + hb_base64Encode( hb_memoRead( "my.html" ) ) )
Re: IE
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
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
- 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
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 )
But you can make it child of any other window using SetParent( webview_get_window( hWebView ), hWndParent )
Re: IE
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 )
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 )
- 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
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
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
- 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
From https://github.com/webview/webview:
So it seems as it also works on Linux. I haven't tried it on Linux yet
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