1. yakov werde
  2. PowerBuilder
  3. Monday, 26 August 2019 13:40 PM UTC

Hello fellow legacy modernization travelers

Is it possible to do dynamic OleCustomControls ?

When an ActiveX is placed on a visual container in the painter, the control is declared in the source code and the painter glues in some binary hidden stuff that is only visible in exported source.  This binary stuff is the magic sauce that makes it all happen.

Start of PowerBuilder Binary Data Section : Do NOT Edit

End of PowerBuilder Binary Data Section : No Source Expected After This Point

I need runtime access to the registry stuff in order to pair the release specific COM ActiveX control to the PowerBuilder application release version

 

At run time (EXE) we do this with side by side COM.  BUT it is not possible to use 'side by side' COM components because PB.EXE is the running program and it has an internal manifest.

 

I was thinking to use variable registry entries - I.e deploy COM components to release specific local folders.  one registry entry per component/release.  This can work for non-visual stuff when I can specify the COM lookup class name. But not for visual COM controls with it's all glued in by painter

Does someone have an example (or is it even possible) to do dynamic olecustomcontrol

 

Thanks

Yakov Werde

Sr Dev.  OpenLink Financial, Agtech division

Roland Smith Accepted Answer Pending Moderation
  1. Monday, 26 August 2019 15:33 PM UTC
  2. PowerBuilder
  3. # 1

Don't place a COM control directly on a window or visual userobject. Create a separate userobject of the COM control and then place that on the window or visual userobject.

The separate COM wrapper userobject would only have PowerScript in it to support the control itself, no business logic. That means that there would be no binary data in the parent object which would reduce source control headaches.

If you want to dynamically use different controls, you can use the OpenUserObject function.

 

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.