xHarbour to Harbour

Re: xHarbour to Harbour

Postby Natter » Mon May 30, 2022 1:10 pm

In xHB, I use timers - DEFINE TIMER. Timers don't work in HB.
In xHB, I use POPU PMENU - MENU oMen POUP, Only the left menu column is visible in the HB
Natter
 
Posts: 1221
Joined: Mon May 14, 2007 9:49 am

Re: xHarbour to Harbour

Postby Antonio Linares » Mon May 30, 2022 2:14 pm

Please provide a small prg to test

Thanks
regards, saludos

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

Re: xHarbour to Harbour

Postby Natter » Tue May 31, 2022 12:28 pm

Code: Select all  Expand view
oCl:=TActiveX():New(oWnd, "Shell.Explorer")

    oCl:Silent:=.T.

    oCl:Do("Navigate2", "file.html")

    do while .T.
      oDk:=oCl:GetProp("Document")
      if valtype(oDk)="U".or.oDk:ReadyState!="complete"
        WaitMessage()
        SysRefresh()
      else
        exit
      endif
    enddo
 


In the xHB open Activex and get a type object type document (1111111:Document)
Next, I can find the element I need on this document el:=oDk:getElementById("id-el") and click on it el:click()

In HB, this does not work. The problem is in the oDk. oDk:getElementById does not work
If I try to display oDk on the screen and get an error

Error description: Error BASE/1081 Argument error: +
Args:
[ 1] = C

[ 2] = U

Stack Calls
===========
Called from: => CHARACTER:__OPPLUS( 0 )
Called from: .\source\function\WQOUT.PRG => (b)WQOUT( 11 )
Called from: => AEVAL( 0 )
Called from: .\source\function\WQOUT.PRG => WQOUT( 11 )
Natter
 
Posts: 1221
Joined: Mon May 14, 2007 9:49 am

Re: xHarbour to Harbour

Postby Antonio Linares » Tue May 31, 2022 4:25 pm

Please post also the code that you use once you get oDk

thank you
regards, saludos

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

Re: xHarbour to Harbour

Postby Natter » Tue May 31, 2022 7:08 pm

If I understood correctly :roll:

I upload an HTML file with scripts for working with the map to the ActiveX object. After receiving the oDk, I can use the DOM to access certain elements of the oDk (document)
For example:

if oDk:DefaultView:itm=123 //itm - is a global variable that is visible both in the program
on FWH and in oDk
el:=oDk:getElenentByID("geo-ecr") // get a document element (button)
el:Click() // imitating a click on this button
endif

I basically moved my program from xharbour to Harbour. But before I start trying webview2, I wanted to check how Harbour works with ActivrX
Natter
 
Posts: 1221
Joined: Mon May 14, 2007 9:49 am

Re: xHarbour to Harbour

Postby Antonio Linares » Wed Jun 01, 2022 5:23 am

Dear Yuri,

If you plan to use webview2 then you don't need to manage ActiveX at all
regards, saludos

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

Re: xHarbour to Harbour

Postby Natter » Wed Jun 01, 2022 6:26 am

Yes, Antonio, you're right. My goal is to use webview2 instead of ActiveX. That's why I had to transfer my program from xHarbour to Harbour
Natter
 
Posts: 1221
Joined: Mon May 14, 2007 9:49 am

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 47 guests