1. Olaf Bönning
  2. PowerBuilder
  3. Monday, 27 March 2023 20:04 PM UTC

...without using the Microsoft Interop Forms Toolkit.

What we do until now: We use the .NET Framework 4.8.1 to write class libraries in C# and expose them to COM using the Interop Forms Toolkit. We call the COM-Server from PowerBuilder 2021. This works fine for invisible classes as well for visible user controls.

What we don't like: The Microsoft Interop Forms Toolkit is super old, and not supported any more.

What we want: Get rid of the toolkit. We want to use the latest .NET Framework (4.8.1) or .NET 8+ with build-in assemblies.

The try: This works super-easy with invisible COM-Servers (see attachment CCWNonVisible.zip).
We wrote an interface, a class which implements the interface. We build the project for x86, set the registration for Interop and use strong names.

But how can i expose a System.Windows.Forms.UserControl to PowerBuilder (see attachment CCWActiveX.zip)? The toolkit adds a manifest. Is this the missing part? 

Many thanks for your ideas!

Btw. i read all the articles i could found for COM Callable Wrappers on the Microsoft sites and all the Bruce Armstrong articles in this Community. Still no idea.

Attachments (2)
Bruce Armstrong Accepted Answer Pending Moderation
  1. Tuesday, 28 March 2023 04:49 AM UTC
  2. PowerBuilder
  3. # 1
Comment
  1. Chris Pollach @Appeon
  2. Tuesday, 28 March 2023 11:39 AM UTC
Hi Olaf;

FWIW: If the ActiveX control is 64 bit, the IDE might not see it because the IDE is still running in 32 bit mode. Just a thought.

Regards... Chris
  1. Helpful
  1. Olaf Bönning
  2. Wednesday, 29 March 2023 09:09 AM UTC
Thanks Chris, i double-checked. ActiveX is 32bit. Issue is resolved. See above.
  1. Helpful
  1. Chris Pollach @Appeon
  2. Wednesday, 29 March 2023 18:12 PM UTC
Excellent!
  1. Helpful
There are no comments made yet.
Armeen Mazda @Appeon Accepted Answer Pending Moderation
  1. Monday, 27 March 2023 23:37 PM UTC
  2. PowerBuilder
  3. # 2

Hi Olaf, Is your .NET component a non-visual library?  If yes, you can use the .NET DLL Importer: https://docs.appeon.com/pb2022/application_techniques/Calling_C_Assembly_in_an_Application.html

Comment
  1. Olaf Bönning
  2. Tuesday, 28 March 2023 06:54 AM UTC
Thanks Armeen, we use visual AND non-visual libraries. The non-visual part is solved. Right now i look for a solution for ActiveX (visual libs). But anyway, i did not know the possibility to import a .NET DLL which is quite helpful.
  1. Helpful
  1. Armeen Mazda @Appeon
  2. Tuesday, 28 March 2023 15:56 PM UTC
You're very welcome. Yes, PB natively only handles non-visual libraries.
  1. Helpful
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Monday, 27 March 2023 22:59 PM UTC
  2. PowerBuilder
  3. # 3

Hi,

We are using a visual wrapped Crystal Report Viewer. Maybe this link can give some insight on how to do this without the Forms Toolkit.

https://community.appeon.com/index.php/qna/q-a/how-to-incorporate-crystal-report-viewer

regards.

MiguelL

Comment
  1. Miguel Leeuwe
  2. Tuesday, 28 March 2023 12:40 PM UTC
Glad it's working. It's a bit tricky, but once you've got it you're done.

I'm not sure about the previous developer you speak of, but I helped out another "Olaf" some time ago, so you're possibly right

regards :)
  1. Helpful
  1. John Fauss
  2. Wednesday, 29 March 2023 18:42 PM UTC
Miguel, I don't believe I said anything at the time, but I want you to know that I think that Crystal Reports wrapper you created a while back was very nice work!
  1. Helpful
  1. Miguel Leeuwe
  2. Thursday, 30 March 2023 06:30 AM UTC
Thanks John, I really (still) am a noob with .Net, but as long as you google enough, eventually you get there. (there wasn't too much on powerbuilder with the new .net crystal reports, but I found one small code example that got me started). I still don't understand why people use Crystal Reports. In our case, it's only because existing customer have loads of predefined reports and they don't want to migrate to anything else.

regards.
  1. Helpful
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.