Welcome Serena Central users! CLICK HERE
The migration of the Serena Central community is currently underway. Be sure to read THIS MESSAGE to get your new login set up to access your account.
CIAC Absent Member.
Absent Member.
1623 views

MS Rich Textbox Control 6.0 exiting

Hello all,

I'm using a MS Rich Textbox Control 6.0 and trying to handle the exiting from a subwindow with keypress event. All is ok (i detect the esc key and that) but when the subwindow is closed, the parent window turn crazy constantly detecting a event termination (96) and window get freezed. 

I try two things:

*
Ef-Rtf-Ev-KeyPress.
   call "C$GETEVENTDATA" using EVENT-CONTROL-HANDLE, 5aux
   end-call
   cancel "C$GETEVENTDATA"
   if 5aux = Tec-Exit
      destroy Screen1-Handle

      perform Acu-Exit-Rtn

   end-if

   .

In this case, the runtime ends beacuse the program reachs stop run line in the acubench generated prodecure acu-exit-rtn that normally don't get executed, but in this case yes:

Acu-Exit-Rtn.
   PERFORM Acu-Close-Files
   PERFORM After-Program
   EXIT PROGRAM
   STOP RUN
.

When i do this: 

*
Ef-Rtf-Ev-KeyPress.
   call "C$GETEVENTDATA" using EVENT-CONTROL-HANDLE, 5aux
   end-call
   cancel "C$GETEVENTDATA"
   if 5aux = Tec-Exit
      destroy Screen1-Handle

      exit program

   end-if

   .

The parent program get freezed like i say in the beginning.

¿Any tips? I'm using Acubench 8.2 with the screen designer.

0 Likes
3 Replies
Micro Focus Expert
Micro Focus Expert

RE: MS Rich Textbox Control 6.0 exiting

I will guess that you want to return to the window and accept values from other controls .. is that correct? Or are you attempting to colse the window to move to a diffwerent window or retunr to a calling program?

In the case of returning to the window, have you tried moving a value to accept-control ...  move 2 to accept-control .. and then move a value into control-id of the control where you want focus

Chapter 6: Events Reference > 6.1 Overview of Events

0 Likes
CIAC Absent Member.
Absent Member.

RE: MS Rich Textbox Control 6.0 exiting

Sorry, I mean to return the control in a calling program. I say "subwindow" but in my program that .acu is threated like a subwindow, not another screen in the same program. That's why in doing an exit program. Only happens when i hit esc from the RTF control because if i hit esc from another cobol control inside the window, the program closes normally. I have this event in that screen, and when the exit goes this way all is ok:

     *

      Screen1-Evt-Teclas.

          evaluate key-status

             when Tec-Exit

                destroy Screen1-Handle

                perform Acu-Exit-Rtn

          end-evaluate

          .

Screen1-Evt-Teclas is the "link to" event in the screen containing the RTF control, and "tec-exit" is asigned to a push button in that window.

Dunno if the activeX must be destroyed or stoped in some way before exiting if the runtime is accepting it.

Thanks for the answer shjerpe.

0 Likes
Micro Focus Expert
Micro Focus Expert

RE: MS Rich Textbox Control 6.0 exiting

I believe the difference you see is that using the Escape key triggers an exception versus your code using an event... with an event the accept on the window is still occurring ( perhaps the reason for the freeze). I would not destroy the activex handle until the program exits.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.