Using WebView with Borland !!!

Re: Using WebView with Borland !!!

Postby cmsoft » Wed Feb 16, 2022 11:32 am

Antonio
No he sido capaz de crear la lib para Borland
Cuando corro:
impdef.exe webview.def webview.dll
Me genera esto:
Code: Select all  Expand view  RUN

LIBRARY     WEBVIEW.DLL

EXPORTS
    webview_bind                   @1   ; webview_bind
    webview_create                 @2   ; webview_create
    webview_destroy                @3   ; webview_destroy
    webview_dispatch               @4   ; webview_dispatch
    webview_eval                   @5   ; webview_eval
    webview_get_window             @6   ; webview_get_window
    webview_init                   @7   ; webview_init
    webview_navigate               @8   ; webview_navigate
    webview_return                 @9   ; webview_return
    webview_run                    @10  ; webview_run
    webview_set_size               @11  ; webview_set_size
    webview_set_title              @12  ; webview_set_title
    webview_terminate              @13  ; webview_terminate
 

Y lo corrijo asi:
Code: Select all  Expand view  RUN

LIBRARY     WEBVIEW.DLL

EXPORTS
    _webview_bind                   @1   ; webview_bind
    _webview_create                 @2   ; webview_create
    _webview_destroy                @3   ; webview_destroy
    _webview_dispatch               @4   ; webview_dispatch
    _webview_eval                   @5   ; webview_eval
    _webview_get_window             @6   ; webview_get_window
    _webview_init                   @7   ; webview_init
    _webview_navigate               @8   ; webview_navigate
    _webview_return                 @9   ; webview_return
    _webview_run                    @10  ; webview_run
    _webview_set_size               @11  ; webview_set_size
    _webview_set_title              @12  ; webview_set_title
    _webview_terminate              @13  ; webview_terminate
 

Y cuando corro despues:
impdef.exe webview.lib webview.def
Me tira este mensaje:
Code: Select all  Expand view  RUN
Embarcadero Impdef Version 3.3.0 Copyright (c) 1991-2014 Embarcadero Technologies, Inc.
Error webview.def: unknown file type

Estoy haciendo algo mal?
Desde ya muchas gracias.
User avatar
cmsoft
 
Posts: 1291
Joined: Wed Nov 16, 2005 9:14 pm
Location: Mercedes - Bs As. Argentina

Re: Using WebView with Borland !!!

Postby Antonio Linares » Wed Feb 16, 2022 12:23 pm

César,

la segunda llamada es:

implib.exe webview.lib webview.def

estas llamando a impdef.exe nuevamente :-)
regards, saludos

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

Re: Using WebView with Borland !!!

Postby cmsoft » Wed Feb 16, 2022 1:49 pm

Excelente!!

Otra consulta, como se define la funcion webview_get_window para borland?
User avatar
cmsoft
 
Posts: 1291
Joined: Wed Nov 16, 2005 9:14 pm
Location: Mercedes - Bs As. Argentina

Re: Using WebView with Borland !!!

Postby Antonio Linares » Wed Feb 16, 2022 3:08 pm

Enhanced version and important fixed bug thanks to Cristobal: We had a missing @ here:

DLL FUNCTION WEBVIEW_CREATE( nDebug AS LONG, @hWndParent AS LONG ) AS LONG PASCAL FROM "webview_create" LIB hDLL

You can use DEFINE WINDOW or DEFINE DIALOG as you may need, or simply place it on a panel control.

webview.prg
Code: Select all  Expand view  RUN
#include "FiveWin.ch"

#define SW_HIDE          0
#define SW_SHOW          5
#define GWL_STYLE      -16

static hDLL, s_nCalls, s_cJsonResult

function Main()

   local oWnd

   hDLL = LoadLibrary( "webview.dll" )

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

   ACTIVATE DIALOG oWnd ;
      ON INIT CreateWebView( oWnd ) CENTER

   FreeLibrary( hDLL )

return nil

function CreateWebView( oWnd )

   local hWebView := WebView_Create( 0, oWnd:hWnd )
   local hWnd     := WebView_Get_Window( hWebView )

   WebView_Set_Size( hWebView, 770, 470, 0 )
   oWnd:SetSize( 1000, 600 )
   WebView_Navigate( hWebView, "file:///c:/soporte/Ramon/test.html" )
   WebView_Bind( hWebView, "SendToFWH", SendToFWHAddress(), hWebView )

return nil

function WebView_SaveValues( cCalls, cJsonResult )

   s_nCalls = Val( cCalls )
   s_cJsonResult = cJsonResult

   MsgInfo( hb_ValToExp( s_cJsonResult ), s_nCalls )

return nil  

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
DLL FUNCTION WEBVIEW_GET_WINDOW( hWebView AS LONG ) AS LONG PASCAL FROM "webview_get_window" LIB hDLL
#define WEBVIEW_HINT_NONE  0   // Width and height are default size
#define WEBVIEW_HINT_MIN   1   // Width and height are minimum bounds
#define WEBVIEW_HINT_MAX   2   // Width and height are maximum bounds
#define WEBVIEW_HINT_FIXED 3   // Window size can not be changed by a user
DLL FUNCTION WEBVIEW_SET_SIZE( hWebView AS LONG, nWidth AS LONG, nHeight AS LONG, nHint AS LONG ) AS VOID PASCAL FROM "webview_set_size" LIB hDLL
DLL FUNCTION WEBVIEW_SET_TITLE( hWebView AS LONG, cTitle AS LPSTR ) AS VOID PASCAL FROM "webview_set_title" LIB hDLL

#pragma BEGINDUMP

#include <hbapi.h>
#include <windows.h>
#include <hbvm.h>

static void SendToFWH( const char * szNumRequests, const char * szJson, void * p )
{
   hb_vmPushSymbol( hb_dynsymGetSymbol( "WEBVIEW_SAVEVALUES" ) );
   hb_vmPushNil();
   hb_vmPushString( szNumRequests, strlen( szNumRequests ) );
   hb_vmPushString( szJson, strlen( szJson ) );
   hb_vmFunction( 2 );
}

HB_FUNC( SENDTOFWHADDRESS )
{
   hb_retnl( ( HB_LONG ) SendToFWH );
}

#pragma ENDDUMP
regards, saludos

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

Re: Using WebView with Borland !!!

Postby Silvio.Falconi » Wed Feb 16, 2022 4:59 pm

Antonio, Anserkk

On Windows 10

Code: Select all  Expand view  RUN

Edizione    Windows 10 Pro
Versione    20H2
Data installazione: ‎01/‎11/‎2021
Build sistema operativo 19042.1348
Esperienza  Windows Feature Experience Pack 120.2212.3920.0




1) I downloaded first this instal exe from https://developer.microsoft.com/en-us/m ... /webview2/ as wrote from Anserkk
2) I create the webview.lib from webview.dll with this configuration

Code: Select all  Expand view  RUN

LIBRARY WEBVIEW.DLL

EXPORTS
_webview_bind @1 ; webview_bind
_webview_create @2 ; webview_create
_webview_destroy @3 ; webview_destroy
_webview_dispatch @4 ; webview_dispatch
_webview_eval @5 ; webview_eval
_webview_get_window @6 ; webview_get_window
_webview_init @7 ; webview_init
_webview_navigate @8 ; webview_navigate
_webview_return @9 ; webview_return
_webview_run @10 ; webview_run
_webview_set_size @11 ; webview_set_size
_webview_set_title @12 ; webview_set_title
_webview_terminate @13 ; webview_terminate


I tried the sample of Antonio ramon.prg http://fivetechsupport.com/forums/viewtopic.php?p=248110&sid=65fe9ba9c00a26a586f10b5636b63fc3#p248110

3) After compiled the test the procedure open a window and then crashed

I have this error

hb_out.log
Code: Select all  Expand view  RUN
Application Internal Error - C:\Work\Errori\WebView\ramon\ramon.Exe
Terminated at: 2022-02-16 17:46:54
Unrecoverable error 6005: Exception error:

    Exception Code:C0000005 ACCESS_VIOLATION
    Exception Address:5B0EDCC9
    EAX:00000000  EBX:00919B48  ECX:00000000  EDX:00916560
    ESI:5B16B56C  EDI:00000000  EBP:0019F184
    CS:EIP:0023:5B0EDCC9  SS:ESP:002B:0019F17C
    DS:002B  ES:002B  FS:0053  GS:002B
    Flags:00010212
    Exception Parameters: 00000000 00000000
    CS:EIP: 8B 08 8B 51 0C 89 55 F8 83 7D 08 00 74 0B 8B 45
    SS:ESP: 3B001548 3B0A8120 0019F1A8 5E5C1D2C 00916560 80010106 00000000 00000000 B33AFC51 80010106 00000000 0019F1DC 5AE591CE 00919B48 80010106 00000000

    C stack:
    EIP:     EBP:       Frame: OldEBP, RetAddr, Params...
    5B0EDCC9 0019F184   0019F1A8 5E5C1D2C 00916560 80010106 00000000 00000000 B33AFC51 80010106 00000000
    5E5C1D2C 0019F1A8   0019F1DC 5AE591CE 00919B48 80010106 00000000 3B0A8120 00000029 80000030 00000000 3538BFCA
    5AE591CE 0019F1DC   0019F234 5AE590E2 00000000 0091FBB8 00000000 00919B48 5B042684 00000030 3B040300 00000033
    5AE590E2 0019F234   0019F270 5AE0DBF3 00000000 0091FBB8 00000000 00919B48 00000000 3B0A80C0 00000029 80000030
    5AE0DBF3 0019F270   0019F294 5E5C265D 00000001 00000000 0091FBB8 00000000 00919B48 0091FBB8 00000000
    5E5C265D 0019F294   0019F2D0 5E5C1343 00907988 00000001 00000000 0091FBB8 00000000 00919B48 0000006E 0000006E
    5E5C1343 0019F2D0   0019F2F4 5E5C1D0A 00000000 00000000 00919B48 3B0A80C0 B33AFF0D 80010106 00000000
    5E5C1D0A 0019F2F4   0019F328 5AE591CE 00919B48 80010106 00000000 3B0A80C0 00000029 80000030 00000000 3538BD3E
    5AE591CE 0019F328   0019F380 5AE590E2 00000000 0091FBB8 00000000 00919B48 5B042684 00000030 0019F364 3B040240
    5AE590E2 0019F380   0019F3BC 5AE0DBF3 00000000 0091FBB8 00000000 00919B48 00000000 3B0A8060 00000029 80000030
    5AE0DBF3 0019F3BC   0019F3E0 5E5C265D 00000001 00000000 0091FBB8 00000000 00919B48 0091FBB8 00000000
    5E5C265D 0019F3E0   0019F41C 5E5C1343 0091FED0 00000001 00000000 0091FBB8 00000000 00919B48 0000006E 0000006E
    5E5C1343 0019F41C   0019F490 5E5C129C 00000000 00000000 00919B48 00000000 5B0F0B56 0019F588 0019F454 00000000
    5E5C129C 0019F490   0019F6E4 5B0F3588 00000000 0091FBB8 00000000 00916560 5CC2C30F 0019F6F4 0090B4D0 0019F518
    5B0F3588 0019F6E4   0019F7D4 5B0E995F 000C05F4 00000000 5B16BCA0 5B0EB87C 0019F708 0091A118 0019F7D4 5B0E990B
    5B0E995F 0019F7D4   0019F7F8 5B0E96D7 00000000 00000000 5CC2C213 0091A118 0019FF60 5B12F0DD FFFFFFFF
    5B0E96D7 0019F7F8   0019F81C 5B0E1090 00000000 00000000 0000000B 00000000 00000000 0091A118 00836F04
    5B0E1090 0019F81C   0019F834 00458021 00000000 00000000 00000000 005A7240
    00458021 0019F834   0019F85C 004E3714 005A754C 00000000 00837FAC 00000026 00000000 025F775C 00000000 00000000
    004E3714 0019F85C   0019F97C 004DD4C6 00000003 00000000 00000000 005A70F0 004FB3D3 02620A2C 0019F894 004FEAFA


Modules:
00400000 0046C000 C:\Work\Errori\WebView\ramon\ramon.Exe
77190000 001A3000 C:\WINDOWS\SYSTEM32\ntdll.dll
76710000 000F0000 C:\WINDOWS\System32\KERNEL32.DLL
75290000 00214000 C:\WINDOWS\System32\KERNELBASE.dll
76E00000 0007A000 C:\WINDOWS\System32\ADVAPI32.DLL
76A30000 000BF000 C:\WINDOWS\System32\msvcrt.dll
76690000 00075000 C:\WINDOWS\System32\sechost.dll
762F0000 000BF000 C:\WINDOWS\System32\RPCRT4.dll
75E00000 000AF000 C:\WINDOWS\System32\COMDLG32.DLL
75510000 00281000 C:\WINDOWS\System32\combase.dll
76BF0000 00120000 C:\WINDOWS\System32\ucrtbase.dll
74810000 00019000 C:\WINDOWS\SYSTEM32\MPR.DLL
74870000 00008000 C:\WINDOWS\SYSTEM32\VERSION.DLL
769A0000 00087000 C:\WINDOWS\System32\shcore.dll
732F0000 0008D000 C:\WINDOWS\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.19041.1110_none_c0da534e38c01f4d\COMCTL32.DLL
74080000 00072000 C:\WINDOWS\SYSTEM32\WINSPOOL.DRV
76800000 001A0000 C:\WINDOWS\System32\USER32.dll
754D0000 00024000 C:\WINDOWS\System32\GDI32.dll
76BD0000 00018000 C:\WINDOWS\System32\win32u.dll
75120000 000DC000 C:\WINDOWS\System32\gdi32full.dll
77030000 00045000 C:\WINDOWS\System32\SHLWAPI.dll
76500000 0007B000 C:\WINDOWS\System32\msvcp_win.dll
757A0000 005B3000 C:\WINDOWS\System32\SHELL32.dll
763B0000 000E3000 C:\WINDOWS\System32\OLE32.DLL
75D60000 00096000 C:\WINDOWS\System32\OLEAUT32.DLL
73380000 00006000 C:\WINDOWS\SYSTEM32\MSIMG32.DLL
73260000 00028000 C:\WINDOWS\SYSTEM32\WINMM.DLL
61240000 0002C000 C:\WINDOWS\SYSTEM32\OLEDLG.DLL
730F0000 00169000 C:\WINDOWS\WinSxS\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.19041.1348_none_d94f9953e1060d01\GDIPLUS.DLL
77000000 00025000 C:\WINDOWS\System32\IMM32.DLL
72F70000 00074000 C:\WINDOWS\system32\uxtheme.dll
5B0E0000 000AB000 C:\Work\Errori\WebView\ramon\webview.dll
5E5C0000 00020000 C:\Work\Errori\WebView\ramon\WebView2Loader.dll
76AF0000 000D3000 C:\WINDOWS\System32\MSCTF.dll
74620000 0000F000 C:\WINDOWS\SYSTEM32\kernel.appcore.dll
750C0000 0005F000 C:\WINDOWS\System32\bcryptPrimitives.dll
63EE0000 000B9000 C:\WINDOWS\SYSTEM32\textinputframework.dll
61110000 0009B000 C:\WINDOWS\System32\CoreMessaging.dll
60E90000 0027E000 C:\WINDOWS\System32\CoreUIComponents.dll
75050000 00063000 C:\WINDOWS\System32\WS2_32.dll
60DB0000 000DB000 C:\WINDOWS\SYSTEM32\wintypes.dll
735D0000 00029000 C:\WINDOWS\SYSTEM32\ntmarta.dll
73290000 00053000 C:\WINDOWS\system32\Oleacc.dll
5ADE0000 002F1000 C:\Program Files (x86)\Microsoft\EdgeWebView\Application\98.0.1108.50\EBWebView\x86\EmbeddedBrowserWebView.dll
72E50000 0000A000 C:\WINDOWS\SYSTEM32\CRYPTBASE.DLL

Called from FWCALLDLL(0)
Called from WEBVIEW_CREATE(56) in ramon.prg
Called from CREATEWEBVIEW(26) in ramon.prg
Called from (b)MAIN(18) in ramon.prg
Called from TWINDOW:ACTIVATE(1083) in .\source\classes\WINDOW.PRG
Called from MAIN(18) in ramon.prg
------------------------------------------------------------------------
 




So it not run also on Windows 10


I tried also the last sample of Antonio , crashed !!!
I Insert the same file on "file:///c:/soporte/Ramon/test.html

Code: Select all  Expand view  RUN
pplication Internal Error - C:\Work\Errori\WebView\sample\webview.Exe
Terminated at: 2022-02-16 18:01:29
Unrecoverable error 6005: Exception error:

    Exception Code:C0000005 ACCESS_VIOLATION
    Exception Address:65C4DCC9
    EAX:00000000  EBX:00A891E8  ECX:00000000  EDX:00A9E410
    ESI:65CCB56C  EDI:00000000  EBP:0019EA04
    CS:EIP:0023:65C4DCC9  SS:ESP:002B:0019E9FC
    DS:002B  ES:002B  FS:0053  GS:002B
    Flags:00010216
    Exception Parameters: 00000000 00000000
    CS:EIP: 8B 08 8B 51 0C 89 55 F8 83 7D 08 00 74 0B 8B 45
    SS:ESP: 23001548 230A8120 0019EA28 72C31D2C 00A9E410 80010106 00000000 00000000 F4252824 80010106 00000000 0019EA5C 5DC891CE 00A891E8 80010106 00000000

    C stack:
    EIP:     EBP:       Frame: OldEBP, RetAddr, Params...
    65C4DCC9 0019EA04   0019EA28 72C31D2C 00A9E410 80010106 00000000 00000000 F4252824 80010106 00000000
    72C31D2C 0019EA28   0019EA5C 5DC891CE 00A891E8 80010106 00000000 230A8120 0000002B 80000030 00000000 064355D9
    5DC891CE 0019EA5C   0019EAB4 5DC890E2 00000000 00A98600 00000000 00A891E8 5DE72684 00000030 2303C300 00000035
    5DC890E2 0019EAB4   0019EAF0 5DC3DBF3 00000000 00A98600 00000000 00A891E8 00000000 230A80C0 0000002B 80000030
    5DC3DBF3 0019EAF0   0019EB14 72C3265D 00000001 00000000 00A98600 00000000 00A891E8 00A98600 00000000
    72C3265D 0019EB14   0019EB50 72C31343 00AA8AE8 00000001 00000000 00A98600 00000000 00A891E8 0000006E 0000006E
    72C31343 0019EB50   0019EB74 72C31D0A 00000000 00000000 00A891E8 230A80C0 F4252978 80010106 00000000
    72C31D0A 0019EB74   0019EBA8 5DC891CE 00A891E8 80010106 00000000 230A80C0 0000002B 80000030 00000000 0643542D
    5DC891CE 0019EBA8   0019EC00 5DC890E2 00000000 00A98600 00000000 00A891E8 5DE72684 00000030 0019EBE4 2303C240
    5DC890E2 0019EC00   0019EC3C 5DC3DBF3 00000000 00A98600 00000000 00A891E8 00000000 230A8060 0000002B 80000030
    5DC3DBF3 0019EC3C   0019EC60 72C3265D 00000001 00000000 00A98600 00000000 00A891E8 00A98600 00000000
    72C3265D 0019EC60   0019EC9C 72C31343 00AA6250 00000001 00000000 00A98600 00000000 00A891E8 0000006E 0000006E
    72C31343 0019EC9C   0019ED0C 72C3129C 00000000 00000000 00A891E8 65C50B56 0019EE04 0019ECD0 65C51528 00000000
    72C3129C 0019ED0C   0019EF60 65C53588 00000000 00A98600 00000000 00A9E410 6168CF1B 0019EF70 00A85058 0019ED94
    65C53588 0019EF60   0019F050 65C4995F 001606C4 00000000 65CCBCA0 65C4B87C 0019F030 00A894E8 0019F050 65C4990B
    65C4995F 0019F050   0019F074 65C496D7 00000000 00836D9C 6168D00F 00A894E8 0019F858 65C8F0DD FFFFFFFF
    65C496D7 0019F074   0019F098 65C41090 00000000 00836D9C 004FF0BC 00836D9C 0019F09C 00A894E8 00836D80
    65C41090 0019F098   0019F0B0 00458021 00000000 00836D9C 00000000 005A71A0
    00458021 0019F0B0   0019F0D8 004E3714 005A7435 00000000 00837E28 00000034 00000000 00E4773C 00000000 00000000
    004E3714 0019F0D8   0019F1F8 004DD4C6 00000003 00000000 00000000 005A70B0 013AAD40 00000000 0000000C 00000000


Modules:
00400000 0046C000 C:\Work\Errori\WebView\sample\webview.Exe
77190000 001A3000 C:\WINDOWS\SYSTEM32\ntdll.dll
76710000 000F0000 C:\WINDOWS\System32\KERNEL32.DLL
75290000 00214000 C:\WINDOWS\System32\KERNELBASE.dll
73530000 0009F000 C:\WINDOWS\SYSTEM32\apphelp.dll
76E00000 0007A000 C:\WINDOWS\System32\ADVAPI32.DLL
76A30000 000BF000 C:\WINDOWS\System32\msvcrt.dll
76690000 00075000 C:\WINDOWS\System32\sechost.dll
762F0000 000BF000 C:\WINDOWS\System32\RPCRT4.dll
75E00000 000AF000 C:\WINDOWS\System32\COMDLG32.DLL
75510000 00281000 C:\WINDOWS\System32\combase.dll
76BF0000 00120000 C:\WINDOWS\System32\ucrtbase.dll
769A0000 00087000 C:\WINDOWS\System32\shcore.dll
74870000 00008000 C:\WINDOWS\SYSTEM32\VERSION.DLL
74810000 00019000 C:\WINDOWS\SYSTEM32\MPR.DLL
76800000 001A0000 C:\WINDOWS\System32\USER32.dll
76BD0000 00018000 C:\WINDOWS\System32\win32u.dll
754D0000 00024000 C:\WINDOWS\System32\GDI32.dll
75120000 000DC000 C:\WINDOWS\System32\gdi32full.dll
76500000 0007B000 C:\WINDOWS\System32\msvcp_win.dll
77030000 00045000 C:\WINDOWS\System32\SHLWAPI.dll
732F0000 0008D000 C:\WINDOWS\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.19041.1110_none_c0da534e38c01f4d\COMCTL32.DLL
757A0000 005B3000 C:\WINDOWS\System32\SHELL32.dll
763B0000 000E3000 C:\WINDOWS\System32\OLE32.DLL
75D60000 00096000 C:\WINDOWS\System32\OLEAUT32.DLL
73380000 00006000 C:\WINDOWS\SYSTEM32\MSIMG32.DLL
73260000 00028000 C:\WINDOWS\SYSTEM32\WINMM.DLL
6CC00000 0002C000 C:\WINDOWS\SYSTEM32\OLEDLG.DLL
730F0000 00169000 C:\WINDOWS\WinSxS\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.19041.1348_none_d94f9953e1060d01\GDIPLUS.DLL
74080000 00072000 C:\WINDOWS\SYSTEM32\WINSPOOL.DRV
77000000 00025000 C:\WINDOWS\System32\IMM32.DLL
72F70000 00074000 C:\WINDOWS\system32\uxtheme.dll
65C40000 000AB000 C:\Work\Errori\WebView\sample\webview.dll
72C30000 00020000 C:\Work\Errori\WebView\sample\WebView2Loader.dll
76AF0000 000D3000 C:\WINDOWS\System32\MSCTF.dll
74620000 0000F000 C:\WINDOWS\SYSTEM32\kernel.appcore.dll
750C0000 0005F000 C:\WINDOWS\System32\bcryptPrimitives.dll
63EE0000 000B9000 C:\WINDOWS\SYSTEM32\textinputframework.dll
60E90000 0027E000 C:\WINDOWS\System32\CoreUIComponents.dll
61110000 0009B000 C:\WINDOWS\System32\CoreMessaging.dll
75050000 00063000 C:\WINDOWS\System32\WS2_32.dll
735D0000 00029000 C:\WINDOWS\SYSTEM32\ntmarta.dll
60DB0000 000DB000 C:\WINDOWS\SYSTEM32\wintypes.dll
73290000 00053000 C:\WINDOWS\system32\Oleacc.dll
5DC10000 002F1000 C:\Program Files (x86)\Microsoft\EdgeWebView\Application\98.0.1108.50\EBWebView\x86\EmbeddedBrowserWebView.dll
72E50000 0000A000 C:\WINDOWS\SYSTEM32\CRYPTBASE.DLL

Called from FWCALLDLL(0)
Called from WEBVIEW_CREATE(45) in webview.prg
Called from CREATEWEBVIEW(26) in webview.prg
Called from (b)MAIN(18) in webview.prg
Called from TDIALOG:INITIATE(864) in .\source\classes\DIALOG.PRG
Called from TDIALOG:HANDLEEVENT(1124) in .\source\classes\DIALOG.PRG
Called from DIALOGBOXINDIRECT(0)
Called from TDIALOG:ACTIVATE(304) in .\source\classes\DIALOG.PRG
Called from MAIN(18) in webview.prg
------------------------------------------------------------------------
 
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7066
Joined: Thu Oct 18, 2012 7:17 pm

Re: Using WebView with Borland !!!

Postby Antonio Linares » Wed Feb 16, 2022 5:23 pm

Dear Silvio,

Please build it using FWH\samples\buildh32.bat with Visual Studio Community 2022

I am going to try it again with Borland
regards, saludos

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

Re: Using WebView with Borland !!!

Postby Silvio.Falconi » Wed Feb 16, 2022 5:53 pm

Antonio Linares wrote:Dear Silvio,

Please build it using FWH\samples\buildh32.bat with Visual Studio Community 2022

I am going to try it again with Borland


Visual Studio Community 2022 ????
I not Know How compiled it with Visual Studio Community 2022
I use xmate very well for my apps

I have this env
Code: Select all  Expand view  RUN

[Environment]
Description 1=For Borland 7
Description 2=HARBOUR
Description 3=
PRG Compiler ver=Harbour
C compiler ver=Bcc7
Subsystem=FWH0217
Author=Falconi Silvio
Last update=06/18/2021

[Advanced]
Command types=1,1,1,1,1,1,1,1,1

[Harbour]
HB_INSTALL=C:\work\HARBOUR
HB_COMMAND=%HB_BIN_INSTALL%\Harbour.Exe %PRG% /m /n0 /gc1 /w0 /es2 /a /i%HB_INC_INSTALL% /j%HOME%\I18n\Main.hil /iinclude;c:\work\fwh\include;%HB_INSTALL%\include
Option prefix=/

[C]
C_INSTALL=C:\work\bcc7
C_COMP_COMMAND=%C_BIN_INSTALL%\Bcc32.Exe -M -c %CRLF%-DHB_OS_WIN_32 %CRLF%-DHB_FM_STATISTICS_OFF %CRLF%-DHB_NO_DEFAULT_API_MACROS %CRLF%-DHB_NO_DEFAULT_STACK_MACROS %CRLF%-I%C_INC_INSTALL%\windows\sdk\;%HB_INC_INSTALL%  -n%HOME%\Obj %C%%CRLF%%CRLF%%CRLF%
C_LIB_COMMAND=%C_BIN_INSTALL%\TLib.Exe %LIB% /P512 @%RSP% , %LST%
C_LINK_COMMAND=%C_BIN_INSTALL%\iLink32.Exe -Gn -aa -Tpe -s -v @%LNK%
C_RC_COMMAND=c:\work\PellesC\Bin\PORC.EXE  %RC%  /I c:\work\pellesc\include /I c:\work\pellesc\include\win
C_DLL_COMMAND=%C_BIN_INSTALL%\iLink32.Exe -Gn -aa -Tpd -M -L%C_LIB_INSTALL% @%LNK%
Option prefix=-

[User]
POSTEXE_COMMAND=
POSTLIB_COMMAND=
POSTDLL_COMMAND=

[Files]
%C_LIB_INSTALL%\C0W32.OBJ=1
%C_LIB_INSTALL%\CW32.LIB=2
C:\Work\FWH\lib\Fiveh.lib=3
C:\Work\FWH\lib\Fivehc.lib=4
%HB_LIB_INSTALL%\hbrtl.lib=5
%HB_LIB_INSTALL%\hbvm.lib=6
%HB_LIB_INSTALL%\hbgt.lib=7
%HB_LIB_INSTALL%\gtgui.lib=8
%HB_LIB_INSTALL%\hblang.lib=9
%HB_LIB_INSTALL%\hbmacro.lib=10
%HB_LIB_INSTALL%\hbcommon.lib=11
%HB_LIB_INSTALL%\hbpp.lib=12
%HB_LIB_INSTALL%\hbrdd.lib=13
%HB_LIB_INSTALL%\rddntx.lib=14
%HB_LIB_INSTALL%\rddcdx.lib=15
%HB_LIB_INSTALL%\rddfpt.lib=16
%HB_LIB_INSTALL%\hbwin.lib=17
%HB_LIB_INSTALL%\hbsix.lib=18
%HB_LIB_INSTALL%\hbziparc.lib=19
%HB_LIB_INSTALL%\hbcpage.lib=20
%HB_LIB_INSTALL%\hbcplr.lib=21
%HB_LIB_INSTALL%\hbmzip.lib=22
%HB_LIB_INSTALL%\minizip.lib=23
%HB_LIB_INSTALL%\xhb.lib=24
%HB_LIB_INSTALL%\hbpcre.lib=25
%HB_LIB_INSTALL%\hbct.lib=26
%HB_LIB_INSTALL%\hbzlib.lib=27
%C_LIB_INSTALL%\uuid.lib=28
%C_LIB_INSTALL%\IMPORT32.LIB=29
%C_LIB_INSTALL%\PSDK\odbc32.lib=30
%C_LIB_INSTALL%\PSDK\nddeapi.lib=31
%C_LIB_INSTALL%\PSDK\iphlpapi.lib=32
%C_LIB_INSTALL%\PSDK\msimg32.lib=33
%C_LIB_INSTALL%\PSDK\ws2_32.lib=34
%C_LIB_INSTALL%\PSDK\psapi.lib=35
%C_LIB_INSTALL%\PSDK\rasapi32.lib=36
%HB_LIB_INSTALL%\png.lib=37
%C_LIB_INSTALL%\PSDK\shell32.lib=38

[DLL Files]
%HB_LIB_INSTALL%\harbour.lib=1
%C_LIB_INSTALL%\C0W32.OBJ=2
%C_LIB_INSTALL%\CW32.LIB=3
%C_LIB_INSTALL%\IMPORT32.LIB=4
 


is there a lib I not link ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7066
Joined: Thu Oct 18, 2012 7:17 pm

Re: Using WebView with Borland !!!

Postby Antonio Linares » Wed Feb 16, 2022 6:20 pm

Dear Silvio,

Please read this in detail:
viewtopic.php?p=246459&sid=67105e174390e3aa74634556c8e05e1a#p246459

Fortunately I was able to intall Win 7 on virtualbox, going to try it on Win 7.

Could you please confirm me if you are using Windows 7 32 or 64 bits ?

thanks
regards, saludos

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

Re: Using WebView with Borland !!!

Postby Antonio Linares » Wed Feb 16, 2022 8:12 pm

Borland users!!! :-)

ok, it seems there is an issue with DLL FUNCTION WEBVIEW_CREATE, so meanwhile we detect it and fix it, we can use this workaround:

"webview_navigate" seems not to be working fine yet, but now it does not crash on WebView_Create() :-)

webview.prg // test for Borland users
Code: Select all  Expand view  RUN
#include "FiveWin.ch"
#include "hbdyn.ch"

function Main()

   local pLib := hb_LibLoad( "webview.dll" )
   local hWebView := hb_DynCall( { "webview_create", pLib, hb_bitOr( hb_SysLong(),;
                             hb_SysCallConv() ), hb_SysLong(),;
                             HB_DYN_CTYPE_LONG, HB_DYN_CTYPE_LONG_PTR }, 0, 0 )

    hb_DynCall( { "webview_navigate", pLib, hb_bitOr( hb_SysLong(),;
                  hb_SysCallConv() ), hb_SysLong(), HB_DYN_CTYPE_CHAR_PTR },;
                  hWebView, "file:///c:/soporte/Ramon/test.html" )

   MsgInfo( "ok" )                        
   
   hb_LibFree( pLib )

return nil

function hb_SysLong()

return If( hb_OSIS64BIT(), HB_DYN_CTYPE_LLONG_UNSIGNED, HB_DYN_CTYPE_LONG_UNSIGNED )  

function hb_SysCallConv()

return If( ! "Windows" $ OS(), HB_DYN_CALLCONV_CDECL, HB_DYN_CALLCONV_STDCALL )
regards, saludos

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

Re: Using WebView with Borland !!!

Postby cmsoft » Wed Feb 16, 2022 8:29 pm

Antonio, que sería hDLL? No esta definida.
Si la cambio por pLib da un mensaje de Ok pero no muestra la pagina web
User avatar
cmsoft
 
Posts: 1291
Joined: Wed Nov 16, 2005 9:14 pm
Location: Mercedes - Bs As. Argentina

Re: Using WebView with Borland !!!

Postby cmsoft » Wed Feb 16, 2022 8:34 pm

Con esto logro mostra bien la pagina, pero no puedo cerrar el dialogo. Ademas me muestra un parpadeo del webview original, aunque despues lo mete en el dialogo.
Code: Select all  Expand view  RUN

#include "FiveWin.ch"
#define SW_HIDE          0
#define SW_SHOW          5
#define GWL_STYLE      -16
STATIC hWebView
function Main()
   local oWnd, oBot, cUrl := 'https://app.pedidosbcn.com/tienda/tiendadepizzas'//cUrl := "file:///c:/fwh16/bares2/gmapb.html"
   DEFINE DIALOG oWnd TITLE "FWH WebView"  

   ACTIVATE DIALOG oWnd ;
      ON INIT CreateWebView( oWnd, cUrl ) CENTER VALID(EndWebView())  
return nil

function CreateWebView(oWnd,cUrl)
   local hWnd
   local nStyle
   hWebView := WebView_Create(0, oWnd)
   hWnd     := WebView_Get_Window( hWebView )
   ShowWindow( hWnd, SW_HIDE )
   oWnd:SetSize( 1000, 600 )

   nStyle   := GetWindowLong( hWnd, GWL_STYLE )
   nStyle   -= WS_CAPTION
   nStyle   -= WS_SYSMENU
   nStyle   += WS_THICKFRAME
   SetWindowLong( hWnd, GWL_STYLE, nStyle )
   SetParent( hWnd, oWnd:hWnd )
   SetWindowPos( hWnd, nil, 1, 1, oWnd:nWidth  - 2, oWnd:nHeight - 2, 0 )
   WebView_Navigate( hWebView, cUrl )  
   ShowWindow( hWnd, SW_SHOW )
   oWnd:Refresh()
return nil

static function EndWebView()

   WebView_Destroy( hWebView )

return .t.

#pragma BEGINDUMP

#include <hbapi.h>
#include <windows.h>
#include <hbvm.h>

void * webview_create(int debug, void * window );
void webview_run( void * w );
void webview_navigate( void * w, const char * url );
void webview_destroy( void * w );
void webview_eval( void * w, const char * javascript );
void webview_bind( void * w, const char * name, void * func, void * pvoid );
int webview_get_window( void * w );

HB_FUNC( WEBVIEW_CREATE )
{
   hb_retptr( webview_create( 0, NULL ) );
}


HB_FUNC( WEBVIEW_RUN )
{
   webview_run( hb_parptr( 1 ) );
}

HB_FUNC( WEBVIEW_NAVIGATE )
{
   webview_navigate( hb_parptr( 1 ), hb_parc( 2 ) );
}

HB_FUNC( WEBVIEW_DESTROY )
{
   webview_destroy( hb_parptr( 1 ) );
}

HB_FUNC( WEBVIEW_BIND )
{
   webview_bind( hb_parptr( 1 ), hb_parc( 2 ), hb_parptr( 3 ), hb_parptr( 4 ) );
}

HB_FUNC( WEBVIEW_EVAL )
{
   webview_eval( hb_parptr( 1 ), hb_parc( 2 ) );
}

HB_FUNC( WEBVIEW_GET_WINDOW )
{
   hb_retni( webview_get_window( hb_parptr( 1 ) ) );
}
/*
static void SendToFWH( const char * szNumRequests, const char * szJson, void * p )
{
   hb_vmPushSymbol( hb_dynsymGetSymbol( "WEBVIEW_SAVEVALUES" ) );
   hb_vmPushNil();
   hb_vmPushString( szNumRequests, strlen( szNumRequests ) );
   hb_vmPushString( szJson, strlen( szJson ) );
   hb_vmFunction( 2 );
}

HB_FUNC( SENDTOFWHADDRESS )
{
   hb_retnl( ( HB_LONG ) SendToFWH );
}
*/

#pragma ENDDUMP
User avatar
cmsoft
 
Posts: 1291
Joined: Wed Nov 16, 2005 9:14 pm
Location: Mercedes - Bs As. Argentina

Re: Using WebView with Borland !!!

Postby Silvio.Falconi » Wed Feb 16, 2022 9:06 pm

Antonio Linares wrote:Dear Silvio,

Please read this in detail:
viewtopic.php?p=246459&sid=67105e174390e3aa74634556c8e05e1a#p246459

Fortunately I was able to intall Win 7 on virtualbox, going to try it on Win 7.

Could you please confirm me if you are using Windows 7 32 or 64 bits ?

thanks

at school I have win seven 32 bit
at home I have win 10 pro
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7066
Joined: Thu Oct 18, 2012 7:17 pm

Re: Using WebView with Borland !!!

Postby Antonio Linares » Wed Feb 16, 2022 9:32 pm

César,

se me pasó modificarlo en el ejemplo. En vez de hDLL tiene que ser pLib.

Es para diferenciar el handle que se obtiene que no es el mismo que nos devuelve LoadLibrary()

Ahora falta saber por que WebView_Navigate() no nos lleva a la URL especificada. Debe haber algún error en el paso de parámetros.
regards, saludos

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

Re: Using WebView with Borland !!!

Postby Jimmy » Wed Feb 16, 2022 9:33 pm

hi Silvio,
Silvio.Falconi wrote:I not Know How compiled it with Visual Studio Community 2022

you do NOT use IDE of MSVC you "just" install it to get need MSVC Files ;)

than
Simply copy the above webview.prg to FWH\samples and do buildh32.bat webview for MSVC and buildg.bat webview for MinGW.
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1732
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: Using WebView with Borland !!!

Postby Antonio Linares » Wed Feb 16, 2022 10:14 pm

Esta llamada ahora parece correcta pero sigue sin funcionar:

Code: Select all  Expand view  RUN
  hb_DynCall( { "webview_navigate", pLib, hb_bitOr( HB_DYN_CTYPE_VOID, hb_SysCallConv() ),;
               hb_SysLong(), HB_DYN_CTYPE_CHAR_PTR },;
               hWebView, "https://www.google.com" )
regards, saludos

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

PreviousNext

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 89 guests