Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.

DoClick Method crashes the system and trouble with Send Event

I have tried to use the method "DoClick" for the SRP Button control, but it crashes my system. I used the Send_Message function to call the method as shown below:
rv = Send_Message(@Window: ".OLE_BUTTON", "DoClick", "0,0", "Left", 0, 0)
This line of code crashes the system every time. I tried using "OLE.DoClick" also with the same result.

I decided to try to use the Send_Event function instead to the OnClick Event, and I am not having any luck there either. I used the following code:
rv = Send_Event(@Window: "OLE_BUTTON", "OnClick", "0,0", "Left", 0, 0)
This doesn't crash the system, so in that regard it is an improvement, but there is no response as expected. I also tried the "OLE.OnClick" in the statement with no change in results.

I tried to see if I could get any of the OLE controls that I have from SRP to respond to Send_Event, but had no luck. The Send_Event function DID work fine for all OI controls that I tested.

Just in case you are wondering... I have put in the CREATE event of the Window the following statement to have the system "listening" for the OLE events:
rv = Send_Message(@Window: ".OLE_BUTTON", "QUALIFY_EVENT", "ALL_OLES", 1)
Is there something that I am missing here?

Comments

  • You can use Send_Event, but you have to keep in mind that all events that come from OLE controls fire the "OLE" event with parameter 1 set to the event. SRP FrameWorks hides this fact, so it's easy to forget this little detail. Try this:
    rv = Send_Event(@Window: "OLE_BUTTON", "OLE", "OnClick", "0,0", "Left", 0, 0)
  • That did the trick!

    Thank you Kevin.
Sign In or Register to comment.