Using WebView with Borland !!!

Re: Using WebView with Borland !!!

Postby Admpss » Wed Feb 16, 2022 11:12 pm

hi, i need an visual studio 2019 or 2022 compact, i use in external ssd drive, i dont install all vs in computer, someone has it? only bin, lib and include?

thanks
Admpss
 
Posts: 26
Joined: Wed Oct 31, 2018 7:37 pm

Re: Using WebView with Borland !!!

Postby Antonio Linares » Thu Feb 17, 2022 6:35 am

Fixed and working fine with Borland !!!

webview.prg
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_DYN_CTYPE_VOID_PTR,;
                             hb_SysCallConv() ), HB_DYN_CTYPE_VOID_PTR,;
                             hb_SysLong(), HB_DYN_CTYPE_VOID_PTR }, 0, 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, "http://www.google.com" )

   hb_DynCall( { "webview_run", pLib, hb_bitOr( HB_DYN_CTYPE_VOID,;
                 hb_SysCallConv() ), HB_DYN_CTYPE_VOID,;
                 HB_DYN_CTYPE_VOID_PTR }, hWebView )
   
   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: 42100
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Using WebView with Borland !!!

Postby Antonio Linares » Thu Feb 17, 2022 8:25 am

Dear Silvio,

Tested on Windows 7 and I get the same error you get:
The procedure entry point SetProcessDpiAwareness Context could not be located in the dynamic link library USER32.dll


SetProcessDpiAwareness docs clearly says:
Minimum supported client Windows 8.1 [desktop apps only]

https://docs.microsoft.com/en-us/windows/win32/api/shellscalingapi/nf-shellscalingapi-setprocessdpiawareness

So Microsoft webview is not Windows 7 compatible. Windows 8.1 at least.

Sorry
regards, saludos

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

Re: Using WebView with Borland !!!

Postby Silvio.Falconi » Thu Feb 17, 2022 9:09 am

Antonio Linares wrote:Dear Silvio,

Tested on Windows 7 and I get the same error you get:
The procedure entry point SetProcessDpiAwareness Context could not be located in the dynamic link library USER32.dll


SetProcessDpiAwareness docs clearly says:
Minimum supported client Windows 8.1 [desktop apps only]

https://docs.microsoft.com/en-us/windows/win32/api/shellscalingapi/nf-shellscalingapi-setprocessdpiawareness

So Microsoft webview is not Windows 7 compatible. Windows 8.1 at least.

Sorry


OK . I must found another solution for Win7
I have read that some games have problems in Windows Seven with this function (setprocessdpiawareness) but they have been corrected I don't understand how, I have put you the links of the pages, you probably need to make a function to recreate it

BTW I tried on Windows 10 Pro on Lenovo Portable Pc and not run

I make this

File batch to create def and lib

Code: Select all  Expand view  RUN
@echo off
echo Creazione file def
 
pause

impdef.exe webview.def webview.dll

echo Creazione file Lib

pause

implib.exe webview.lib webview.def



then I compile ( batch file)

Code: Select all  Expand view  RUN
set path=c:\work\bcc7\bin
c:\work\harbour\bin\hbmk2 webview.prg -lwebview -comp=bcc


I have this error
Image
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: 7063
Joined: Thu Oct 18, 2012 7:17 pm

Re: Using WebView with Borland !!!

Postby Silvio.Falconi » Thu Feb 17, 2022 9:43 am

Antonio,
I 'm trying with Lenovo Pc with Windows 10 Pro 64 bit

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


I compile the last webview.prg you wrote in this topic
the exe open a window but then crash

Code: Select all  Expand view  RUN

application Internal Error - C:\Work\Errori\WebView\Source\webview.Exe
Terminated at: 2022-02-17 10:35:44
Unrecoverable error 6005: Exception error:

    Exception Code:C0000005 ACCESS_VIOLATION
    Exception Address:600DDCC9
    EAX:00000000  EBX:00B771A8  ECX:00000000  EDX:00B90468
    ESI:6015B56C  EDI:00000000  EBP:0019F5E4
    CS:EIP:0023:600DDCC9  SS:ESP:002B:0019F5DC
    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: 4DC01548 4DCA8120 0019F608 6EB21D2C 00B90468 80010106 00000000 00000000 D328D0E3 80010106 00000000 0019F63C 5FE491CE 00B771A8 80010106 00000000

    C stack:
    EIP:     EBP:       Frame: OldEBP, RetAddr, Params...
    600DDCC9 0019F5E4   0019F608 6EB21D2C 00B90468 80010106 00000000 00000000 D328D0E3 80010106 00000000
    6EB21D2C 0019F608   0019F63C 5FE491CE 00B771A8 80010106 00000000 4DCA8120 0000002B 80000030 00000000 1B3C42AE
    5FE491CE 0019F63C   0019F694 5FE490E2 00000000 00B91708 00000000 00B771A8 60032684 00000030 4DC3C300 00000035
    5FE490E2 0019F694   0019F6D0 5FDFDBF3 00000000 00B91708 00000000 00B771A8 00000000 4DCA80C0 0000002B 80000030
    5FDFDBF3 0019F6D0   0019F6F4 6EB2265D 00000001 00000000 00B91708 00000000 00B771A8 00B91708 00000000
    6EB2265D 0019F6F4   0019F730 6EB21343 00B85898 00000001 00000000 00B91708 00000000 00B771A8 0000006E 0000006E
    6EB21343 0019F730   0019F754 6EB21D0A 00000000 00000000 00B771A8 4DCA80C0 D328D1BF 80010106 00000000
    6EB21D0A 0019F754   0019F788 5FE491CE 00B771A8 80010106 00000000 4DCA80C0 0000002B 80000030 00000000 1B3C431A
    5FE491CE 0019F788   0019F7E0 5FE490E2 00000000 00B91708 00000000 00B771A8 60032684 00000030 0019F7C4 4DC3C240
    5FE490E2 0019F7E0   0019F81C 5FDFDBF3 00000000 00B91708 00000000 00B771A8 00000000 4DCA8060 0000002B 80000030
    5FDFDBF3 0019F81C   0019F840 6EB2265D 00000001 00000000 00B91708 00000000 00B771A8 00B91708 00000000
    6EB2265D 0019F840   0019F87C 6EB21343 00B99468 00000001 00000000 00B91708 00000000 00B771A8 0000006E 0000006E
    6EB21343 0019F87C   0019F8F4 6EB2129C 00000000 00000000 00B771A8 0019F8E4 0019FCAC 600E0B56 0019F9EC 00000000
    6EB2129C 0019F8F4   0019FB48 600E3588 00000000 00B91708 00000000 00B90468 A70FF6B5 0019FB58 00B47F70 0019F97C
    600E3588 0019FB48   0019FC38 600D995F 0015047E 00000000 6015BCA0 600DB87C 0019FB30 00B77028 0019FC38 600D990B
    600D995F 0019FC38   0019FC5C 600D96D7 00000000 00000000 A70FF1A1 00B77028 0019FF60 6011F0DD FFFFFFFF
    600D96D7 0019FC5C   0019FC80 600D1090 00000000 00000000 00000008 00000000 005021CB 00B77028 0049222B
    600D1090 0019FC80   0019FD54 00492368 00000000 00000000 00000000 00FE11DC 00000002 00000004 00000000 00000000


Modules:
00400000 00473000 C:\Work\Errori\WebView\Source\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
74810000 00019000 C:\WINDOWS\SYSTEM32\MPR.DLL
75510000 00281000 C:\WINDOWS\System32\combase.dll
74870000 00008000 C:\WINDOWS\SYSTEM32\VERSION.DLL
76BF0000 00120000 C:\WINDOWS\System32\ucrtbase.dll
769A0000 00087000 C:\WINDOWS\System32\shcore.dll
74080000 00072000 C:\WINDOWS\SYSTEM32\WINSPOOL.DRV
732F0000 0008D000 C:\WINDOWS\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.19041.1110_none_c0da534e38c01f4d\COMCTL32.DLL
754D0000 00024000 C:\WINDOWS\System32\GDI32.dll
76800000 001A0000 C:\WINDOWS\System32\USER32.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
730F0000 00169000 C:\WINDOWS\WinSxS\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.19041.1348_none_d94f9953e1060d01\GDIPLUS.DLL
6CA50000 0002C000 C:\WINDOWS\SYSTEM32\OLEDLG.DLL
77000000 00025000 C:\WINDOWS\System32\IMM32.DLL
72F70000 00074000 C:\WINDOWS\system32\uxtheme.dll
600D0000 000AB000 C:\Work\Errori\WebView\Source\webview.dll
6EB20000 00020000 C:\Work\Errori\WebView\Source\WebView2Loader.dll
76AF0000 000D3000 C:\WINDOWS\System32\MSCTF.dll
74620000 0000F000 C:\WINDOWS\SYSTEM32\kernel.appcore.dll
750C0000 0005F000 C:\WINDOWS\System32\bcryptPrimitives.dll
6E3E0000 000B9000 C:\WINDOWS\SYSTEM32\textinputframework.dll
65A70000 0009B000 C:\WINDOWS\System32\CoreMessaging.dll
63F80000 0027E000 C:\WINDOWS\System32\CoreUIComponents.dll
75050000 00063000 C:\WINDOWS\System32\WS2_32.dll
65510000 000DB000 C:\WINDOWS\SYSTEM32\wintypes.dll
735D0000 00029000 C:\WINDOWS\SYSTEM32\ntmarta.dll
73290000 00053000 C:\WINDOWS\system32\Oleacc.dll
5FDD0000 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 HB_DYNCALL(0)
Called from MAIN(9) 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: 7063
Joined: Thu Oct 18, 2012 7:17 pm

Re: Using WebView with Borland !!!

Postby cmsoft » Thu Feb 17, 2022 10:32 am

Antonio Linares wrote:Fixed and working fine with Borland !!!

Excelente! Muchas gracias!
User avatar
cmsoft
 
Posts: 1290
Joined: Wed Nov 16, 2005 9:14 pm
Location: Mercedes - Bs As. Argentina

Re: Using WebView with Borland !!!

Postby Antonio Linares » Thu Feb 17, 2022 1:53 pm

Silvio,

Please try this:

local pLib := hb_LibLoad( "webview.dll" )

MsgInfo( pLib )

and let me know what you get
regards, saludos

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

Re: Using WebView with Borland !!!

Postby cmsoft » Thu Feb 17, 2022 1:58 pm

Aca logré ponerla en un dialogo, dejo el ejemplo.
Hay que mejorarlo porque hace un parpadeo poco estético, pero vamos avanzando muy bien...
Code: Select all  Expand view  RUN
#include "FiveWin.ch"
#include "hbdyn.ch"
#define SW_HIDE          0
#define SW_SHOW          5
#define GWL_STYLE      -16
STATIC pLib, hWebView
function Main()
   local oWnd, oBot, cUrl := "https://app.pedidosbcn.com/tienda/tiendadepizzas"
   hWebView := ARRAY(2)
   pLib := hb_LibLoad( "webview.dll" )
   DEFINE DIALOG oWnd TITLE "FWH WebView" SIZE 1200,500  
   @ 05,05 BUTTON oBot PROMPT "Formato Web"   ACTION CreateWebView(oWnd,cUrl,1) SIZE 50,12 PIXEL
   @ 25,05 BUTTON oBot PROMPT "Formato movil" ACTION CreateWebView(oWnd,cUrl,2,350) SIZE 50,12 PIXEL
   ACTIVATE DIALOG oWnd CENTER
   hb_LibFree( pLib )
return nil

function CreateWebView(oWnd,cUrl, n, nAncho)

   local hWnd, nStyle, nOtra := IF(n = 1,2,1)
   DEFAULT nAncho := oWnd:nWidth  - 2
   oWnd:SetSize( if(n==2,500,1200), 500 )
   IF !hWebView[nOtra] == nil
      hWnd     := hb_DynCall( { "webview_get_window", pLib, hb_bitOr( HB_DYN_CTYPE_VOID, hb_SysLong() ),;
                 HB_DYN_CALLCONV_CDECL,;
                 HB_DYN_CTYPE_LONG_UNSIGNED }, hWebView[nOtra] )
      ShowWindow( hWnd, SW_HIDE )
      oWnd:Refresh()
   ENDIF
   IF !hWebView[n] == nil
      hWnd     := hb_DynCall( { "webview_get_window", pLib, hb_bitOr( HB_DYN_CTYPE_VOID, hb_SysLong() ),;
                 HB_DYN_CALLCONV_CDECL,;
                 HB_DYN_CTYPE_LONG_UNSIGNED }, hWebView[n] )
      ShowWindow( hWnd, SW_SHOW )
      oWnd:Refresh()
      RETURN nil
   ENDIF
   hWebView[n] := 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)  
   hWnd     := hb_DynCall( { "webview_get_window", pLib, hb_bitOr( HB_DYN_CTYPE_VOID, hb_SysLong() ),;
                 HB_DYN_CALLCONV_CDECL,;
                 HB_DYN_CTYPE_LONG_UNSIGNED }, hWebView[n] )

   ShowWindow( hWnd, SW_HIDE )  

   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,120, nAncho, oWnd:nHeight - 2, 0 )
   ShowWindow( hWnd, SW_SHOW )
   oWnd:Refresh()
   hb_DynCall( { "webview_navigate", pLib, hb_bitOr( HB_DYN_CTYPE_VOID, hb_SysCallConv() ),;
                 HB_DYN_CTYPE_VOID_PTR, HB_DYN_CTYPE_CHAR_PTR },;
                 hWebView[n], cUrl )  
     
   /*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

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 )
User avatar
cmsoft
 
Posts: 1290
Joined: Wed Nov 16, 2005 9:14 pm
Location: Mercedes - Bs As. Argentina

Re: Using WebView with Borland !!!

Postby Antonio Linares » Thu Feb 17, 2022 2:57 pm

César,

bravo !!! Tu ejemplo buenísimo !

Nos falta portar algunas funciones aún al modelo de Harbour pero como bien dices, vamos avanzando :-)
regards, saludos

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

Re: Using WebView with Borland !!!

Postby Maurizio » Thu Feb 17, 2022 5:33 pm

Ciao Antonio

you can have html file of the example ? --> file:///c:/soporte/Ramon/test.html

Grazie
Maurizio
User avatar
Maurizio
 
Posts: 824
Joined: Mon Oct 10, 2005 1:29 pm

Re: Using WebView with Borland !!!

Postby Silvio.Falconi » Fri Feb 18, 2022 9:35 am

Antonio Linares wrote:Silvio,

Please try this:

local pLib := hb_LibLoad( "webview.dll" )

MsgInfo( pLib )

and let me know what you get



Image
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: 7063
Joined: Thu Oct 18, 2012 7:17 pm

Re: Using WebView with Borland !!!

Postby Admpss » Fri Feb 18, 2022 2:57 pm

i know this post is about borland i use this, but i want try with VS, but i use portable storage to plug in my notebooks, work, home, so i dont wanna install full VS, where i can find an small VS with only necessary files? with support to ADS too.

very thanks
Admpss
 
Posts: 26
Joined: Wed Oct 31, 2018 7:37 pm

Re: Using WebView with Borland !!!

Postby Antonio Linares » Fri Feb 18, 2022 5:15 pm

Maurizio wrote:Ciao Antonio

you can have html file of the example ? --> file:///c:/soporte/Ramon/test.html

Grazie
Maurizio
Dear Mauricio,

The html code is in this thread:

viewtopic.php?p=248103&sid=6b8b4951c965a745e1b59fc3580edbe2#p248103
regards, saludos

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

Re: Using WebView with Borland !!!

Postby Antonio Linares » Fri Feb 18, 2022 5:21 pm

Silvio.Falconi wrote:
Antonio Linares wrote:Silvio,

Please try this:

local pLib := hb_LibLoad( "webview.dll" )

MsgInfo( pLib )

and let me know what you get



Image
Dear Silvio,

Then it means that webview.dll has been properly loaded as the pointer is not null

Enviado desde mi px5 mediante Tapatalk
regards, saludos

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

Re: Using WebView with Borland !!!

Postby Antonio Linares » Fri Feb 18, 2022 5:26 pm

Admpss wrote:i know this post is about borland i use this, but i want try with VS, but i use portable storage to plug in my notebooks, work, home, so i dont wanna install full VS, where i can find an small VS with only necessary files? with support to ADS too.

very thanks


We recently posted in these forums the urls to download the microsoft official reduced versions, lets look for them
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42100
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 67 guests