Skip to Content

How can I register an already existing control instance with the CL_GUI_OBJET=>H_GUI object?

The SAP GUI control framework allows you to create your own controls by subclassing CL_GUI_CONTROL and overriding the CONSTRUCTOR, passing your own COM CLSID to the super constructor.

What this does is eventually to call CL_GUI_CONTROL->INIT_CONTROL to create an instance of the COM object by calling method 'CreateControl' of H_GUI (an instance of SAPGUI.APPLICATION), passing it the SHELLID value that was generated.

This allows for handling events by the SAPGUI.APPLICATION instance, which can then be dispatched back to the control class.

However, what I want to do is to create my own COM object instance and register it with the SAPGUI.APPLICATION instance, instead of having it create it for me. (In this case it is a control created by calling a method on a Forms.Frame.1 (MS Forms 2) object).

The reason I need to do this is to be able to handle events generated by the control. If the object is not created by the SAPGUI.APPLICATION instance with an appropriate SHELLID, it seems that you cannot register events with the GUI Control Framework to have it handle them for you.

The COM object 'SAPGUI.APPLICATION' which is instantiated in the method 'CLASS_INIT' of CL_GUI_OBJECT has no documentation anywhere I can find, the usages of the attribute H_GUI of the class show only certain available methods.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

0 Answers