Page 29 of 39
Posted: Tue Mar 03, 2009 8:26 pm
by Kwai chang caine
SROD...... i don't say i love you, because i know that's unnerve you
But i'm so happy
You are more quick than lucky lucke
In again a few time ...you give the answer before the question
I have just replace, the "False" by "Faux" in french
You see, i move a little bit in programming
I don't want to overuse of your kindness, but have you a tips for this #"ยค$$*$ of button
It's crazy, the button of the web page are never the same

Posted: Tue Mar 03, 2009 8:32 pm
by srod
No sorry.
Posted: Tue Mar 03, 2009 8:34 pm
by Kwai chang caine
Never mind i'm already so proud of you.
And you have help me so much

Posted: Tue Mar 03, 2009 11:44 pm
by srod
Kwai, to avoid the "False", "Faux", use the following instead :
Code: Select all
;/////////////////////////////////////////////////////////////////////////////////
;***COMate*** COM automation through iDispatch.
;*===========
;*
;*Execute JavaScript in WebGadget demo by Timo Harter (Freak), Ricardo and Stephen Rodriguez.
;/////////////////////////////////////////////////////////////////////////////////
IncludePath "..\"
XIncludeFile "COMate.pbi"
Enumeration
#FormWeb
#WebGadget
EndEnumeration
Procedure.i ExecuteJavaScript(Gadget, Command$)
Protected browser.COMateObject,documentDispatch.COMateObject, script.COMateObject
Protected result
browser = COMate_WrapCOMObject(GetWindowLong_(GadgetID(Gadget), #GWL_USERDATA))
If browser
documentDispatch = browser\GetObjectProperty("Document")
If documentDispatch
script = documentDispatch\GetObjectProperty("script")
If script
result = script\Invoke("eval('" + command$ + "')")
If Result < 0
Debug COMate_GetLastErrorDescription()
EndIf
script\release()
EndIf
documentDispatch\Release()
EndIf
browser\Release()
EndIf
ProcedureReturn result
EndProcedure
Define.COMateObject WebObject
OpenWindow(#FormWeb, 0, 0, 800, 600, "", #PB_Window_MinimizeGadget|#PB_Window_MaximizeGadget|#PB_Window_SizeGadget|#PB_Window_ScreenCentered)
WebGadget(#WebGadget, 10, 10, WindowWidth(#FormWeb) - 20, WindowHeight(#FormWeb) - 60, "")
SetGadgetText(#WebGadget, "https://signin.ebay.fr/ws/eBayISAPI.dll?SignIn&UsingSSL=1&pUserId=&co_partnerId=2&siteid=71&ru=http%3A%2F%2Fcgi5.ebay.fr%2Fws2%2FeBayISAPI.dll%3FSellItem%26hm%3Dnu.s5tjbhnm575%26%26hc%3D1%26guest%3D1&pageType=1144")
WebObject = COMate_WrapCOMObject(GetWindowLong_(GadgetID(#WebGadget), #GWL_USERDATA))
status=-1
If WebObject
While Status
While WindowEvent():Delay(1):Wend
Status = WebObject\GetIntegerProperty("Busy")
Wend
WebObject\Release()
EndIf
ExecuteJavaScript(#WebGadget, "document.all.userid.value=" + Chr(34) + "xxxxx" + Chr(34))
ExecuteJavaScript(#WebGadget, "document.all.pass.value=" + Chr(34) + "xxxxx" + Chr(34))
Repeat
Evenement = WaitWindowEvent ()
Until Evenement = #PB_Event_CloseWindow
Posted: Wed Mar 04, 2009 12:19 am
by Kwai chang caine
Thanks a lot SROD
You are a mother for me
You are perhaps proud of me,....... because KCC not turn round his thumb since last question, i ask to you
I have found a solution for clik on the button
I put her, if you are interesting or if somebody need to buy automatically to Ebay a day, in the same time that he sleep
For click on the left button "S'inscrire"
Code: Select all
ExecuteJavaScriptGadget(#WebGadget, "document.forms[0].submit()")
For click on the right button "Ouvrir une session"
Code: Select all
ExecuteJavaScriptGadget(#WebGadget, "document.forms[1].submit()")
This is your splendid code bad modify by KCC for open your account, if obviously you have a account in EBAY France
Code: Select all
;/////////////////////////////////////////////////////////////////////////////////
;***COMate*** COM automation through iDispatch.
;*===========
;*
;*Execute JavaScript in WebGadget demo by Timo Harter (Freak), Ricardo and Stephen Rodriguez.
;/////////////////////////////////////////////////////////////////////////////////
IncludePath "..\"
XIncludeFile "COMate.pbi"
Enumeration
#FormWeb
#WebGadget
EndEnumeration
Procedure Waiting()
Define.COMateObject WebObject
WebObject = COMate_WrapCOMObject(GetWindowLong_(GadgetID(#WebGadget), #GWL_USERDATA))
status=-1
If WebObject
While Status
While WindowEvent():Delay(1):Wend
Status = WebObject\GetIntegerProperty("Busy")
Wend
WebObject\Release()
EndIf
EndProcedure
Procedure.i ExecuteJavaScript(Gadget, Command$)
Protected browser.COMateObject,documentDispatch.COMateObject, script.COMateObject
Protected result
browser = COMate_WrapCOMObject(GetWindowLong_(GadgetID(Gadget), #GWL_USERDATA))
If browser
documentDispatch = browser\GetObjectProperty("Document")
If documentDispatch
script = documentDispatch\GetObjectProperty("script")
If script
result = script\Invoke("eval('" + command$ + "')")
If Result < 0
Debug COMate_GetLastErrorDescription()
EndIf
script\release()
EndIf
documentDispatch\Release()
EndIf
browser\Release()
EndIf
ProcedureReturn result
EndProcedure
OpenWindow(#FormWeb, 0, 0, 800, 600, "", #PB_Window_MinimizeGadget|#PB_Window_MaximizeGadget|#PB_Window_SizeGadget|#PB_Window_ScreenCentered)
WebGadget(#WebGadget, 10, 10, WindowWidth(#FormWeb) - 20, WindowHeight(#FormWeb) - 60, "")
SetGadgetText(#WebGadget, "https://signin.ebay.fr/ws/eBayISAPI.dll?SignIn&UsingSSL=1&pUserId=&co_partnerId=2&siteid=71&ru=http%3A%2F%2Fcgi5.ebay.fr%2Fws2%2FeBayISAPI.dll%3FSellItem%26hm%3Dnu.s5tjbhnm575%26%26hc%3D1%26guest%3D1&pageType=1144")
Waiting()
ExecuteJavaScript(#WebGadget, "document.all.userid.value=" + Chr(34) + "xxxxx" + Chr(34)) ; <====== Change for your username
ExecuteJavaScript(#WebGadget, "document.all.pass.value=" + Chr(34) + "xxxxx" + Chr(34)) ; <====== Change for your password
Waiting()
ExecuteJavaScript(#WebGadget, "document.forms[1].submit()")
Repeat
Evenement = WaitWindowEvent ()
Until Evenement = #PB_Event_CloseWindow
Again thanks my good SROD
You and me it's the dream team

Posted: Wed Mar 04, 2009 9:13 am
by Kwai chang caine
Hello SROD
I have a question who run in my head.
I have put the
Define.COMateObject WebObject in the procedure and that's works fine like this
Code: Select all
Procedure Waiting()
Define.COMateObject WebObject
WebObject = COMate_WrapCOMObject(GetWindowLong_(GadgetID(#WebGadget), #GWL_USERDATA))
status=-1
If WebObject
While Status
While WindowEvent():Delay(1):Wend
Status = WebObject\GetIntegerProperty("Busy")
Wend
WebObject\Release()
EndIf
EndProcedure
I want to know if it's possible to put it out the procedure in global for all the program ??? :roll:
Because i can't find a place out of the procedure who it is recognized

Posted: Wed Mar 04, 2009 11:16 am
by srod
Well yes, you can make it global if you want - like any variable.
Posted: Wed Mar 04, 2009 12:16 pm
by Kwai chang caine
Like usually, i don't understand
I'm alone to can't declare this object GLOBAL
Because before disturb you, i have try several ways :
Code: Select all
Global COMateObject WebObject
Global.COMateObject WebObject
Global Define.COMateObject WebObject
And always an error
Decidedly..... i'm really a wafer

Posted: Wed Mar 04, 2009 12:19 pm
by Kiffi
Posted: Wed Mar 04, 2009 3:14 pm
by Kwai chang caine
You too you are always here when Wafer KCC have problem
I have thinking at all, without this way
So......even it's a little bit more difficult for found this answer....
I assume totally that i say
Thanks a lot my good KIFFI
LOL of LOL
Posted: Thu Mar 05, 2009 9:29 am
by glops
oh my god, thanks to you KCC, I forget there is a crisis in the world when I read your posts ! dammm...how to stop to laugh now ?
When I try to imagine how you try to compile 1 prog, with all your questions, I just begin to smile ! TY

Re: LOL of LOL
Posted: Thu Mar 05, 2009 10:17 am
by srod
glops wrote:... When I try to imagine how you try to compile 1 prog, with all your questions, I just begin to smile ! TY

I don't think KCC compiles his programs! Instead, I reckon he throws them at his bedroom wall and if they don't stick to the wall then he decides there must be a bug within the code!

Posted: Thu Mar 05, 2009 11:42 am
by Kwai chang caine
glops wrote:When I try to imagine how you try to compile 1 prog
Great SROD wrote:I don't think KCC compiles his programs
Compiles programs
What is it ???
Aaaahhh !! it's for that !!!!!
I must compile all the programs before use it
It's for that, it never works
Me i replace the .pb extension by .exe, and i sell it in all the word
It's the reason why, i have go bankrupt all my enterprise of software since several years ago :roll:
Thanks for your great tips.......
KCC remember now !!!!
Before distribute program exe......KCC must click on the little worm drive in the PB IDE
You are really friends for me, to say me your great secret tips :
"Compile before use"

Posted: Thu Mar 05, 2009 11:45 am
by Kwai chang caine
oh my god, thanks to you KCC, I forget there is a crisis in the world when I read your posts ! dammm...how to stop to laugh now ?
When I try to imagine how you try to compile 1 prog, with all your questions, I just begin to smile ! TY
Thanks for your kind compliment.
He go directly in my heart and make me a smile

Posted: Thu Mar 05, 2009 11:48 am
by srod
Me i replace the .pb extension by .exe, and i sell it in all the word
LOL!
