cancel
Showing results for 
Search instead for 
Did you mean: 

Flush After Changing Registry

stefan_schnell
Active Contributor
0 Kudos

Hello community,

I developed an ABAP function, which changes the Windows registry - here add some keys for registering an ActiveX library. But direct after the changing it is not possible to create the object of the library. It is necessary to restart the ABAP program, to use the new keys from the Windows registry. I check Call Method cl_gui_cfw=>flush but with no success. Is there a way, after the changing of the Windows registry, to use the new keys, without restarting the ABAP program?

Thanks for tips.

Cheers

Stefan

Accepted Solutions (1)

Accepted Solutions (1)

stefan_schnell
Active Contributor
0 Kudos

Hello community,

problem is solved. It is neccessary to execute the changing of the registry synchronous and all works well.

Cheers

Stefan

Former Member
0 Kudos

Can you explain in detail how you resolve your issue?

stefan_schnell
Active Contributor
0 Kudos

Hello Roman,

thanks for your interest.

Sure, to change the registry, in my case to register an ActiveX library, I use the command RUNDLL32.EXE with the method EXECUTE from the FES:

"-Register Library---------------------------------------------------
  Call Method cl_gui_frontend_services=>execute
    Exporting
      APPLICATION = 'RUNDLL32.EXE'
      PARAMETER = 'Test.dll,DLLRegisterServer'
      DEFAULT_DIRECTORY = 'C:\Dummy'
      SYNCHRONOUS = 'X'
    Exceptions
      Others = 1.

And here is it necessary to set the SYNCHRONOUS flag. Otherwise the new entries are not written in the Windows registry before the ABAP program wants to use it.

Cheers

Stefan

Former Member
0 Kudos

Thanks for answer.

Regards,

Roman

Answers (1)

Answers (1)

Former Member
0 Kudos

Can you provide errors you receive?

stefan_schnell
Active Contributor
0 Kudos

Hello Roman,

I get no errors. I use the following code:

Create Object 'Test'.
If sy-subrc <> 0.
  Call Function 'DLLRegisterServer'.
  Create Object 'Test'.
EndIf.

Call Function with the registering of the library works perfect but the creating of the object afterwards don't. I must restart the ABAP program and then it works.

Cheers

Stefan

Former Member
0 Kudos

Not sure you use the right pattern for working with ActiveX controls. Whether you read about SAP Control Framework? Other links:

Use Your Own ActiveX Control in ABAP

Using Classic ActiveX Controls in the ABAP Control Framework

It's just my opinion only. I have never done this myself.

stefan_schnell
Active Contributor
0 Kudos

Hello Roman,

thanks for the interesting links.

Cheers

Stefan