Page 2 of 2
Re: xHarbour to Harbour
Posted: Mon May 30, 2022 1:10 pm
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
Re: xHarbour to Harbour
Posted: Mon May 30, 2022 2:14 pm
by Antonio Linares
Please provide a small prg to test
Thanks
Re: xHarbour to Harbour
Posted: Tue May 31, 2022 12:28 pm
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 )
Re: xHarbour to Harbour
Posted: Tue May 31, 2022 4:25 pm
by Antonio Linares
Please post also the code that you use once you get oDk
thank you
Re: xHarbour to Harbour
Posted: Tue May 31, 2022 7:08 pm
by Natter
If I understood correctly
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
Re: xHarbour to Harbour
Posted: Wed Jun 01, 2022 5:23 am
by Antonio Linares
Dear Yuri,
If you plan to use webview2 then you don't need to manage ActiveX at all
Re: xHarbour to Harbour
Posted: Wed Jun 01, 2022 6:26 am
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