FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour IE
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: IE
Posted: Thu May 26, 2022 12:07 PM

Please check if a log file is created and if yes, please post its contents here

thanks

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Re: IE
Posted: Thu May 26, 2022 12:28 PM
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: IE
Posted: Thu May 26, 2022 12:31 PM

Whats your code in line 41 ?

Called from WEBVIEW_CREATE(41) in webview.prg
Called from MAIN(11) in webview.prg

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Re: IE
Posted: Thu May 26, 2022 12:37 PM

include "FiveWin.ch"

static hDLL

function Main()

local hWebView

hDLL = LoadLibrary( "webview.dll" )

hWebView = WebView_Create( 0, 0 )
* WebView_Navigate( hWebView, Html() ) // or use a URL like "https://www.fivetechsoft.com/test.html" )
WebView_Navigate( hWebView, "https://www.fivetechsoft.com" )
// WebView_Eval( hWebView, 'document.body.style.backgroundColor = "blue"' )
WebView_Bind( hWebView, "test", Test(), hWebView )
WebView_Run( hWebView )
WebView_Destroy( hWebView )

FreeLibrary( hDLL )

return nil

function Html()

local cHtml

TEXT INTO cHtml
data:text/html,
<html>
<head>
</head>
<body style="background-color:cyan">
<h2>Using WebView from FWH</h2>
<button onclick='test( 123, "Hello" )'>Call FWH app from web browser</button>
</body>
</html>
ENDTEXT

return cHtml

DLL FUNCTION WEBVIEW_CREATE( nDebug AS LONG, hWndParent AS LONG ) AS LONG PASCAL FROM "webview_create" LIB hDLL
DLL FUNCTION WEBVIEW_RUN( hWebView AS LONG ) AS VOID PASCAL FROM "webview_run" LIB hDLL
DLL FUNCTION WEBVIEW_NAVIGATE( hWebView AS LONG, cUrl AS LPSTR ) AS VOID PASCAL FROM "webview_navigate" LIB hDLL
DLL FUNCTION WEBVIEW_DESTROY( hWebView AS LONG ) AS VOID PASCAL FROM "webview_destroy" LIB hDLL
DLL FUNCTION WEBVIEW_BIND( hWebView AS LONG, cName AS LPSTR, pFunc AS LONG, pVoid AS LONG ) AS VOID PASCAL FROM "webview_bind" LIB hDLL
DLL FUNCTION WEBVIEW_EVAL( hWebView AS LONG, cJavaScript AS LPSTR ) AS VOID PASCAL FROM "webview_eval" LIB hDLL

pragma BEGINDUMP

include <hbapi.h>

include <windows.h>

static void test( const char * x, const char * y) //, void * t )
{
MessageBox( 0, x, y, 0 );
}

HB_FUNC( TEST )
{
hb_retnl( ( HB_LONG ) test );
}

pragma ENDDUMP

Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Re: IE
Posted: Thu May 26, 2022 12:41 PM

line 41 - WebView_Run( hWebView )

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: IE
Posted: Thu May 26, 2022 11:14 PM

Dear Natter,

You are not using the right source code.

The example to test it is this one:

viewtopic.php?p=248148sid=527fd8b7ebd2776b65ec419985ebf4da#p248148

&

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Re: IE
Posted: Fri May 27, 2022 07:14 AM

Yes, Antonio, this example works. If it could be assembled under Xharbour it would be very convenient. :(
Where can I see the description of the functions from Webview.dll ?

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: IE
Posted: Fri May 27, 2022 07:16 AM
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Re: IE
Posted: Thu Jun 02, 2022 06:57 PM

How do I open a WebView in my application window?
How do I upload an html file to WebView ?

Is it possible to get an example of using functions webView.dll :
webview_bind
webview_destroy
webview_dispatch
webview_eval
webview_get_window
webview_init
webview_return
webview_set_size
webview_set_title
webview_terminate

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: IE
Posted: Thu Jun 02, 2022 09:36 PM

What C compiler do you use ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Re: IE
Posted: Fri Jun 03, 2022 04:08 AM

BCC7

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: IE
Posted: Sat Jun 04, 2022 06:46 AM
Dear Yuri,

We have managed to create a new Class TWebView that uses the same source code with all C compilers (Borland, Microsoft, MinGW) and it works also with xHarbour !!! :-)

It will be published in next FWH build

Code (fw): Select all Collapse
// Please install <!-- m --><a class="postlink" href="https://developer.microsoft.com/en-us/microsoft-edge/webview2/">https://developer.microsoft.com/en-us/m ... /webview2/</a><!-- m --> x86 version before using it

#include "FiveWin.ch"

function Main()

   local oWebView := TWebView():New()

   oWebView:Navigate( "http://www.google.com" )
   oWebView:Run()
   oWebView:Destroy()

return nil
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Re: IE
Posted: Sat Jun 04, 2022 08:27 AM

Thank you, Antonio! This is good news. However, on June 15, Microsoft promises to disable Internet Explorer. :(
I got the impression that it is not possible to run more or less complex html files in webview2 - the webview2 window closes immediately.

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: IE
Posted: Sat Jun 04, 2022 09:36 AM
For detailed documentation about each method please review webview.dll docs (embedded into the header file):

https://github.com/webview/webview/blob/master/webview.h
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: IE
Posted: Sat Jun 04, 2022 09:38 AM

Dear Yuri,

> I got the impression that it is not possible to run more or less complex html files in webview2 - the webview2 window closes immediately

We have been able to make Google maps work with it, so I would say there are no limits.

What HTML are you loading that is causing troubles ?

You may be doing it in a wrong way

regards, saludos

Antonio Linares
www.fivetechsoft.com