Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Custom controls in SAPGUI 720

0 Kudos
147

Hi together,

we use a couple of custom controls, written in C++. Everything works fine till the moment we switch from SAPGUI 640 to 720. Now all controls are invisible. Has anyone an idea. Here a sample code how we initialize the controls:


  IF frm_ctrl IS INITIAL.
    CREATE OBJECT:
      frm_ctrl EXPORTING container_name = 'FRM_CTRL',
      ctrl
        EXPORTING
           parent             = frm_ctrl
           name               = 'TestCtrl'
        EXCEPTIONS
          cntl_error         = 1
          cntl_install_error = 2
          OTHERS             = 3.

    IF sy-subrc <> 0.
      MESSAGE w000(38) WITH 'Fatal Ctrl Error'.
      LEAVE TO SCREEN 0.
    ENDIF.

    CALL METHOD ctrl->set_visible
      EXPORTING
        visible           = 'X'
      EXCEPTIONS
        cntl_error        = 1
        cntl_system_error = 2
        OTHERS            = 3.

    IF sy-subrc <> 0.
      MESSAGE w000(38) WITH 'Fatal Ctrl Error'.
      LEAVE TO SCREEN 0.
    ENDIF.
  ENDIF.

and the CONSTRUCTOR code of the ABAP wrapper class


  CLASS cl_gui_cfw DEFINITION LOAD.

  DATA: clsid(80).
  IF NOT cl_gui_object=>activex IS INITIAL.
    clsid         = 'TESTOCX.TestOCXCtrl.1'.
  ELSE.
    RAISE cntl_error.
  ENDIF.

  IF shellstyle IS INITIAL.
    shellstyle = cl_gui_control=>ws_visible +
                 cl_gui_control=>ws_child +
                 cl_gui_control=>ws_clipsiblings.
  ENDIF.

  CALL METHOD super->constructor
    EXPORTING
      clsid             = clsid
      lifetime          = lifetime_default
      shellstyle        = shellstyle
      parent            = parent
      autoalign         = 'x'
      licensekey        = licensekey
      name              = name
    EXCEPTIONS
      cntl_system_error = 1
      OTHERS            = 2.

  CALL METHOD cl_gui_cfw=>flush
    EXCEPTIONS
      cntl_system_error = 1
      cntl_error        = 2
      OTHERS            = 3.

  CASE sy-subrc.
    WHEN 0.
    WHEN 1.
      RAISE cntl_install_error.
    WHEN OTHERS.
      RAISE cntl_error.
  ENDCASE.

  CALL METHOD cl_gui_cfw=>subscribe
    EXPORTING
      ref     = me
      shellid = me->h_control-shellid
    EXCEPTIONS
      OTHERS  = 1.

  IF sy-subrc NE 0.
    RAISE cntl_error.
  ENDIF.

BTW: The controls are loaded and initialized, all methods of the control can be called without any problems.

Thanks Thomas

1 REPLY 1

Former Member
0 Kudos
60

Hi,

I'm not that familiar with custom OCX controls...Could this be a registration problem?

Kr,

m.