Page 25 of 39

Posted: Sat Feb 14, 2009 12:14 pm
by Kwai chang caine
SROD my MASTER i love you :D
You know always that :roll:

In this time, i write a new thread for say how i'm sad that nobody interest to the management of internet explorer :cry:
I have the feeling that i'm alone in the world to want this, then that in a small time, too much application is with the WEB.

You don't know how you make pleasure to me.
I have believe that you don't want to talk to me, and i unnerve you to post in your splendid thread, with my IDIOT idea :oops:
I'm happy to see that you help your servant 8)
It's a good day today, thanks to you the sun wake up in my head :D

I admire so much you, that i don't want disturb you, even only one second.
I'm so proud to know you and other, that i'm always be afraid to write a sentence or a word who irk you.

Thanks thanks thanks, for your great present.
And thanks to explain to me, what is the code of RICARDO in comparison of the great COMATE
I understand now (I know it's a miracle, alleluia :lol:)

I have quickly finish my thread to call for somebody who have the same need that me.
You can read this in several minut.
When i have begin the other thread, i believe i'm alone in the word, and don't know that you have help me in this thread :wink:

Posted: Sat Feb 14, 2009 12:15 pm
by srod
Kwai, I would answer that if I had even the faintest idea what you are talking about? :)

Posted: Sat Feb 14, 2009 12:20 pm
by Kwai chang caine
It's difficult to explain that i have in my head and again more difficult to explain what i have on my heart :oops:
Already in french it's too strong, but in english ....
I have posted the new thread, if you have the kindness to read it and say to me what are you thinking about this ??? :roll:

I have just test your code.
It's a GREAT SROD code 8)

And it's so much simple :shock:
But for you obviously, because for me, even open the IDE is a great emotion :lol:

Posted: Sat Feb 14, 2009 2:30 pm
by srod
Update - 14th Feb. 2009.

COMate version 1.2.1.

First, only the version of COMate for PB 4.3 has had this update. COMate for PB 4.2 remains at version 1.1.7

Following on from the recent 1.2.0 update, I discovered (with the aid of Kinglestat) the fact that our ActiveX event handlers were not re-entrant. Basically, if an event fired and your event handler invoked a method or property which caused another event to fire then all the parameters sent to your original handler would be invalidated!!!

This has now been fixed and event handlers are now fully re-entrant.

You can access the download through the nxSoftware site.

Posted: Sat Feb 14, 2009 5:04 pm
by blueb
This could come in very handy, Thanks SRod

Posted: Sun Feb 15, 2009 7:39 pm
by Kwai chang caine
I try to use the code of SROD in a client web and not with a webgadget.
The first instruction works fine, but the second don't works.
Somebody know why ??? :roll:

Thanks in advance for your help

Code: Select all

IncludePath "..\"
XIncludeFile "COMate.pbi"

Procedure.i ExecuteJavaScript(browser.COMateObject , command$) 
 Protected documentDispatch.COMateObject, script.COMateObject 
 Protected result 

 If browser 
   documentDispatch = browser\GetObjectProperty("Document") 
   If documentDispatch 
     script = documentDispatch\GetObjectProperty("script") 
     If script 
       result = script\Invoke("eval('" + command$ + "')") 
       script\release() 
     EndIf  
     documentDispatch\Release() 
   EndIf 
   browser\Release() 
 EndIf 
 ProcedureReturn result 
EndProcedure 

Define.COMateObject WebObject 

HTTPObject.COMateObject 
HTTPObject = COMate_CreateObject("InternetExplorer.Application") 

If HTTPObject 
 
 HTTPObject\SetProperty("Visible= #True") 
 HTTPObject\invoke("Navigate('http://www.google.fr/')") 
 
 While status$ <> "OK" ;"Terminé"
  Status$ = HTTPObject\GetStringProperty("StatusText") 
  Delay(10)
 Wend 
 
 ExecuteJavaScript(HTTPObject,"document.all.q.value=" + Chr(34) + "Hello pure basic" + Chr(34)) 
 Delay(10)
 ExecuteJavaScript(HTTPObject,"document.all.btnG.click()") 
 
 HTTPObject\Release() 
 
EndIf 

Posted: Sun Feb 15, 2009 9:08 pm
by srod
Damn, there must be a forum button which prevents Kwai from posting in my threads!!! :roll:

:)

Kwai, I had to replace "OK" for "Done" here. Also, and far far far more seriously, the first time you call the ExecuteJavaScript() function, you are actually releasing the HTTPObject object because of the line browser\Release().

Remove this line and it works fine here.

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"

Procedure.i ExecuteJavaScript(browser.COMateObject , command$) 
 Protected documentDispatch.COMateObject, script.COMateObject 
 Protected result 

 If browser 
   documentDispatch = browser\GetObjectProperty("Document") 
   If documentDispatch 
     script = documentDispatch\GetObjectProperty("script") 
     If script 
       result = script\Invoke("eval('" + command$ + "')") 
       script\release() 
     EndIf  
     documentDispatch\Release() 
   EndIf 
 EndIf 
 ProcedureReturn result 
EndProcedure 

Define.COMateObject WebObject 

HTTPObject.COMateObject 
HTTPObject = COMate_CreateObject("InternetExplorer.Application") 

If HTTPObject 
  
 HTTPObject\SetProperty("Visible= #True") 
 HTTPObject\invoke("Navigate('http://www.google.fr/')") 
  
 While status$ <> "Done" ;"Terminé" 
  Status$ = HTTPObject\GetStringProperty("StatusText") 
  Delay(10) 
 Wend 

 ExecuteJavaScript(HTTPObject,"document.all.q.value=" + Chr(34) + "Hello pure basic" + Chr(34)) 
 Delay(10) 
 ExecuteJavaScript(HTTPObject,"document.all.btnG.click()") 
  
 HTTPObject\Release() 
  
EndIf 

Posted: Sun Feb 15, 2009 9:56 pm
by utopiomania
srod, I'm sitting on an ImageMan activeX component for image manipulation that I used in VB.
Can I use it with PB with the help of your COMmate??

Posted: Sun Feb 15, 2009 9:59 pm
by srod
I don't know; try it.

If by an ActiveX component you mean an ActiveX control then it should be easy enough. If this 'component' does not have a visual interface then you'll just need to use COMate's 'regular' automation facilities (as opposed to the ActiveX control hosting commands etc.)

Posted: Sun Feb 15, 2009 10:05 pm
by utopiomania
Ok, I will. It costed me $595, so I hope it is well behaved enough :)

Posted: Sun Feb 15, 2009 11:03 pm
by Kwai chang caine
Damn, there must be a forum button which prevents Kwai from posting in my threads!!!
I love your humor SROD :lol: :lol: :lol:
Kwai, I had to replace "OK" for "Done"
Because i don't know what is the word who is writting in the statusbar when the IE is english
In france it's "Terminé", the "OK" i take that in another code :wink:
you are actually releasing the HTTPObject object because of the line browser\Release().
I' m really a mule :oops:
But i believe that i release only the browser and not the HTTPObject :roll:

Hey SROD !!!!
What do you mean of your student ???? :roll:
I have write this code alone, like a great :D
I have try one thousand of line before post my question
I was not so far of the good way, no ????

I hope you are also proud of your IDIOT MAN like i'm proud to be yours :lol:
KCC move quickly when he talk to you 8)

I thank you very very much SROD you are really too strong 8)
I wait this answer with dribble in the mouth :D

Posted: Sun Feb 15, 2009 11:10 pm
by Kwai chang caine
Excuse me but i have again a little problem
I have ask this question on the othe thread and RICARDO and me have not found the solution :cry:
I know that i abuse but if you have one minut 8)

Do you know why i have an error " 'o' have the null value " ???
It's just before the page appears

Code: Select all

IncludePath "..\" 
XIncludeFile "COMate.pbi" 

Define.COMateObject WebObject 

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$ + "')") 
        script\release() 
      EndIf  
      documentDispatch\Release() 
    EndIf 
    browser\Release() 
  EndIf 
  ProcedureReturn result 
EndProcedure 


If OpenWindow(0, 10000, 0, 0, 0, "WebGadget",  #PB_Window_SystemMenu|#PB_Window_Maximize) 
  WebGadget(0, 0, 0, WindowWidth(0)+50,WindowHeight(0)-100, "http://www.google.fr/") 
  
  ButtonGadget(1,50,WindowHeight(0)-50,150,25,"Fill & Send") 
  Repeat 
    Event = WaitWindowEvent(); 
    Select Event 
      Case #PB_Event_Gadget 
        Select EventGadget() 
          Case 1 
            xMessage$ = "Hello from PB :)" 
            ExecuteJavaScript(0,"document.all.q.value=" + Chr(34) + xMessage$ + Chr(34)) 
            Delay(10)
            ExecuteJavaScript(0,"document.all.btnG.click()")
            ;ExecuteJavaScript(0,"document.post.btnG.click()") 
        EndSelect 
      Case #PB_Event_CloseWindow 
        Break 
    EndSelect 
  Until GetAsyncKeyState_(#VK_ESCAPE) 
EndIf 

Posted: Sun Feb 15, 2009 11:25 pm
by rsts
it's not good form to post the same question in multiple posts :D :shock: :cry: :lol: :?:

cheers

Posted: Sun Feb 15, 2009 11:42 pm
by Kwai chang caine
Yes i know, i'm ashamed :oops:

But i'm so exited now that i have modify alone for the first time a code of the great SROD :D

I believe that perhaps the master have don't see my question :roll:
But i know in me, that the master see all 8)

I have working all this week end on this code, and now it's late in france, and i believe that i can have the answer for go to bed and sleep a very good night with the smile all the night :D
And it's not easy to sleep with a big smile all the night.....believe me :roll:

But it's perhaps late also in the country of the great master, and he must also take a rest for protect his precious nerve cell and also can support the futur question of his personal furuncle :oops:

i excuse to you for have transgress the law of the forum because i'm so happy :oops:

Well, the master sleep surely, i go to bed me too.
I wish a good night at all the members of this great forum

And i say at tomorrow, unhappiness for you all :oops:

Posted: Mon Feb 16, 2009 11:21 am
by srod
I'd already seen the post Kwai in the other thread (my thread again!) If I'd known the answer then I would have replied already.