xHarbour to Harbour

Natter
Posts: 1244
Joined: Mon May 14, 2007 9:49 am

Re: xHarbour to Harbour

Post by Natter »

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
User avatar
Antonio Linares
Site Admin
Posts: 42597
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 40 times
Been thanked: 86 times
Contact:

Re: xHarbour to Harbour

Post by Antonio Linares »

Please provide a small prg to test

Thanks
regards, saludos

Antonio Linares
www.fivetechsoft.com
Natter
Posts: 1244
Joined: Mon May 14, 2007 9:49 am

Re: xHarbour to Harbour

Post by Natter »

Code: Select all | Expand

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 )
User avatar
Antonio Linares
Site Admin
Posts: 42597
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 40 times
Been thanked: 86 times
Contact:

Re: xHarbour to Harbour

Post by Antonio Linares »

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

thank you
regards, saludos

Antonio Linares
www.fivetechsoft.com
Natter
Posts: 1244
Joined: Mon May 14, 2007 9:49 am

Re: xHarbour to Harbour

Post by Natter »

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
User avatar
Antonio Linares
Site Admin
Posts: 42597
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 40 times
Been thanked: 86 times
Contact:

Re: xHarbour to Harbour

Post by Antonio Linares »

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
Natter
Posts: 1244
Joined: Mon May 14, 2007 9:49 am

Re: xHarbour to Harbour

Post by Natter »

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
Post Reply