How to fire "Submit" button in Explorere ActiveX?

Postby Antonio Linares » Wed Sep 10, 2008 5:21 pm

regards, saludos

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

Postby Patrick Mast » Thu Sep 11, 2008 7:14 am

Antonio,

Sorry, but I can't get it to work. I always get error trying to do the :Submit()

I tried:
oActiveX:GetProp("Document"):GetProp("Forms"):Submit()
oActiveX:GetProp("Document"):GetProp("Forms")[0]:Submit()
oActiveX:GetProp("Document"):GetProp("Forms[0]"):Submit()
oActiveX:GetProp("Document"):GetProp("frm_test"):Submit()

And so many other variants, but no luck. Can you try it on your end?
Thanks!

To give you a hint, this is a working xHarbour sample:
Code: Select all  Expand view
PROCEDURE Main()

   LOCAL oIE

   oIE := CreateObject( "InternetExplorer.Application" )
   oIE:Navigate( "http://www.winfakt.be/form_test_1.htm" )
   oIE:Visible := .T.

   WHILE oIE:Busy
      SecondsSleep( 1 )
   END

   oIE:Document:Forms[0]:Submit()

RETURN


Patrick
User avatar
Patrick Mast
 
Posts: 246
Joined: Sat Mar 03, 2007 8:42 pm

Postby Antonio Linares » Thu Sep 11, 2008 7:56 am

Patrick,

Please try it this way:

oActiveX:GetProp("Document"):Forms[0]:Submit()
regards, saludos

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

Postby Patrick Mast » Thu Sep 11, 2008 8:01 am

Antonio Linares wrote:Please try it this way:
oActiveX:GetProp("Document"):Forms[0]:Submit()
Works!!!
Damned!! Why did I forget to try just THAT one.. :)

Thanks Antonio!

Patrick
User avatar
Patrick Mast
 
Posts: 246
Joined: Sat Mar 03, 2007 8:42 pm

Postby Antonio Linares » Thu Sep 11, 2008 8:09 am

This is a brief explanation about the Class TActiveX that may help to other users too:

An ActiveX control is like another "visual" control, where events arrive, and has properties (GetProp(), SetProp() methods) and methods (Do() method).

The ActiveX control manages OleAuto objects, so when we do:

oDoc = oActiveX:GetProp( "document" )

oDoc is an OleAuto object. From that moment on, we can manage oDoc as we are used with OleAuto objects :-)
regards, saludos

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

Postby Patrick Mast » Thu Sep 11, 2008 8:15 am

Antonio,

Antonio Linares wrote:oDoc = oActiveX:GetProp( "document" )
oDoc is an OleAuto object. From that moment on, we can manage oDoc as we are used with OleAuto objects :-)
Yes, this is the trick! With oDoc we can do a lot of things now!

Thanks! ;-)

Patrick
User avatar
Patrick Mast
 
Posts: 246
Joined: Sat Mar 03, 2007 8:42 pm

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 59 guests