Hello community,

nearly one year ago I presented here the possibility to analyze COM libraries, with different programming languages development perspectives. In the context of this possibility I created an example program, which generates ABAP code for rapid testing of COM functions. Now I extend the example program, it is now also possible to create a complete wrapper class with one-click from all functions of a COM library.

/wp-content/uploads/2015/06/001_732833.jpg

I presented here an example which uses Debenu PDF Quick ActiveX Library, and I see it is very troublesome to code for each method of the COM library a method of an ABAP wrapper class. So I decided to extend my example program.

Hint: In some cases it is possible that a COM library uses more than one interface and more than one ProgID for this interfaces. You must differentiate the interfaces of the ProgIDs manually. To simplify this you can set a checkbox “Interfacenames as comments” which adds at the generation the name of the interface as comment. So you can copy the methods from the interfaces you need quickly.

Hint: Not all variable types are supported: I1, I2, I4, I8, UI1, UI2, UI4, UI8, INT, BOOL and UINT as INTEGER, R4, R8 and DECIMAL as F, BSTR as STRING and IDISPATCH, IUNKNOWN as OLE2_OBJECT. All other variable types e.g. like PTR or VARIANT must be converted manually.

You can download the example program and the library here.

2015/07/22: An update is available with minor additions:

  • Methods WriteBAL and IsActiveX are now automatically generated.
  • Use BAL or Message is now switchable.
  • To use a get/set prefix for Get and Set Property is now switschable.
  • Correction for get/set attributes variable assignment.
  • In a few cases it could be possible that a COM library doesn’t store the direction of the parameters e.g. [in][out], this will be considered now.

2015/07/19: An update is available with minor additions:

  • Methods LoadLib, FreeLib and Flush are now automatically generated.
  • A hint comment on top of the class to SAP note 633105 is implemented now.

2015/07/16: An update is available with minor additions:

  • Method names with a length > 30 characters are identified with a comment.
  • Unknown variable types are identified with a comment. So you can find this kind of deviation fast and correct it quickly.

Enjoy it.

Cheers

Stefan

To report this post you need to login first.

2 Comments

You must be Logged on to comment or reply to a post.

Leave a Reply