Antview - Webview2 - Microsoft Edge

479 views
Skip to first unread message

Bernard Mouille

unread,
Jan 7, 2023, 5:34:30 PM1/7/23
to Harbour Users
Hello,

Is somebody can help me to run the Antview ocx with HB32 ?


Regards,
Bernard.

Vlademiro Landim

unread,
Jan 7, 2023, 9:30:22 PM1/7/23
to Harbour Users
Probably the OCX was developed in 64bits platform.  The question is: Can an app written in 32bit use a 64bit OCX?

Test with harbour 64bits.

Vlademiro Landim

unread,
Jan 7, 2023, 9:32:46 PM1/7/23
to Harbour Users
In the next post I will attach a harbour 64bits. I don't know if is possible.

Vlademiro Landim

unread,
Jan 7, 2023, 9:35:47 PM1/7/23
to Harbour Users

Bernard Mouille

unread,
Jan 7, 2023, 10:58:29 PM1/7/23
to Harbour Users
Hello Vlademiro,
Thanks for your answers.
I have download your file but it is a Harbour install.
Antview works in 32 and 64 bits ( 2 ocx ).
I work also in dBase ( 32 bits ) and it works good.
I do know how to run an ocx with Harbour.
Regards,
Bernard.

Vlademiro Landim

unread,
Jan 8, 2023, 12:50:18 AM1/8/23
to Harbour Users

Okay Bernard. 
 I'll download and see if I can run the control. 

 I'll post the test results here. 

 Today I am still awake.

 I'll go to sleep and see if I can get something later.



Bernard Mouille

unread,
Jan 8, 2023, 4:06:06 AM1/8/23
to Harbour Users
Thanks  Vlademiro,
I am now trying with HMG : its works.
I do not know how to use an event function by sample with Internet Explorer.
Regards,
Bernard.

// Begin code.

/* Test.prg.
   Test de ActiveX.
*/

#include "hmg.ch"

#define BM_URL_TO_RUN "http://bernard.mouille.free.fr/"

function Main()
   DEFINE WINDOW Win1 ;
      AT     0,0 ;
      WIDTH  1100 ;
      HEIGHT  600 ;
      TITLE  "Test ActiveX" ;
      MAIN

      @ 10, 10 ACTIVEX Test ;
         WIDTH  1060  ;
         HEIGHT  540  ;
         PROGID "shell.explorer.2"

   END WINDOW

   form_onOpen()
   Activate Window Win1
   return nil

function form_onOpen()
   Win1.Test.Object:Navigate( BM_URL_TO_RUN )
   return nil

// ********************************
// How to run this event function ?
// ********************************
function DocumentComplete(pDisp, URL)
  wapi_MessageBox( valtype( pDisp ) + " " + URL )
  return nil

// End code.

Auge & Ohr

unread,
Jan 8, 2023, 4:23:37 PM1/8/23
to Harbour Users
hi,

> I am now trying with HMG :

which HMG Version are you using ?
latest HMG Version v3.5 include Webviev2 Interface

Jimmy

Vlademiro Landim

unread,
Jan 8, 2023, 4:28:00 PM1/8/23
to Harbour Users

Auge & Ohr

I am using HMG3.5 
 Is there any example?

Auge & Ohr

unread,
Jan 8, 2023, 4:36:17 PM1/8/23
to Harbour Users

Bernard Mouille

unread,
Jan 8, 2023, 5:08:40 PM1/8/23
to Harbour Users
Hello,
Many thanks.
Regards,
Bernard.

Vlademiro Landim

unread,
Jan 8, 2023, 5:15:13 PM1/8/23
to Harbour Users
Thanks Auge

Bernard, test this example, please


I got it from the link sent by Auge. 
 I just modified the build_cpp.bat file 

rem SET HMGPATH=G:\AGL\HMG\3.5
 SET HMGPATH=c:\hmg.3.5  

Bernard Mouille

unread,
Jan 9, 2023, 2:29:25 AM1/9/23
to Harbour Users
Hello Vlademi,
Thanks for your code, it works.
My project is to have an equivalent of Internet Explorer.
My code worked very well with IE but, now, Microsoft Edge has not activeX.
I use the commands of MS Edge.exe actually but it is not very good.
The webview2 HMG sample is not good for me.
My application works automatic 24h/24.
That I need with a secure browser code ( to not seem as a hacker ) :
1) Get all the links of the web page ( I do this with the html source ).
2) Accept all cookies.
3) Print to pdf the web page.
4) Get the body text of the web page ( optional : I convert the pdf file to txt ).
With Antview ocx and dBase, I can do this, but i prefer Harbour or HMG.
I am not good in C.
Regards,
Bernard.

Bernard Mouille

unread,
Apr 25, 2023, 7:45:32 AM4/25/23
to Harbour Users
Is it a link with some webview2 sample for :
- Print to pdf the web page.
- Get the html source.
- Get the page title.
- Get the url source ( if redirected ).
- Know if the navigation is terminated.

Thanks,
Bernard.

Bernard Mouille

unread,
May 1, 2023, 5:03:48 AM5/1/23
to Harbour Users
Hello,
I have solved  :

- Get the html source.
- Get the page title.

I have found in webview2.h version 1.0.1777-prerelease ( modified ) :
        DECLSPEC_XFGVIRT(ICoreWebView2, PrintToPdf)
        HRESULT ( STDMETHODCALLTYPE *PrintToPdf )(
            ICoreWebView2 * This,
            LPCWSTR resultFilePath,
            ICoreWebView2PrintSettings *printSettings,
            ICoreWebView2PrintToPdfCompletedHandler *handler);

I can compile wihout error but, when I run, bug and hb_out.log

Is somebody can give the way to create a default parameters for ICoreWebView2PrintSettings and ICoreWebView2PrintToPdfCompletedHandler ?

I do not know the c++ language.

Regards,
Bernard.

Bernard Mouille

unread,
May 12, 2023, 3:23:01 PM5/12/23
to Harbour Users
Hello,
That I need is in the attached code.
Thanks,
Bernard.

Test.txt
Reply all
Reply to author
Forward
0 new messages