1. Arcady Abramov
  2. PowerBuilder
  3. Thursday, 23 September 2021 08:06 AM UTC

Hello, all

I am pretty sure I already know the answer to this, but now with PB 2021 is out I shall give it a hail Mary...

Given: PB Classic desktop app, has to consume multiple .NET classes for external communications and other purposes.

All .NET classes have properties, which are also .NET classes (not simple data types).

PB .NET DLL importer cannot import properties, which are not simple data types. Without this capability the whole thing is useless for us - the pre-flood OLE works better.

Question: am I missing the way this capability is supported or it is not supported and we are stuck with OLEs until the end of times? I believe I raised this issue first in 2019 (year, not the version).

 

Thank you

Arcady

 

Miguel Leeuwe Accepted Answer Pending Moderation
  1. Thursday, 23 September 2021 15:45 PM UTC
  2. PowerBuilder
  3. # 1

Like Armeen said,

You should create a public function in C# that calls the function you wanted to call and which returns the unsupported datatype and then convert the return data to a standard datatype like for example string. Maybe you have to create more than one function to get all of the information of the more complex datatype.
That's (or those are) the function(s) you'd be able to import with the DLL import tool.
It's a bit of work, but not impossible.

regards

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Thursday, 23 September 2021 14:00 PM UTC
  2. PowerBuilder
  3. # 2

Hi Archdy;

  Have you tries the new DotNetObject system class and the new ".NET DLL Importer" utility that was introduced in PB2019R3?

FYI: https://docs.appeon.com/pb2019r2/application_techniques/ch20s02.html

Regards ... Chris

Comment
There are no comments made yet.
Armeen Mazda @Appeon Accepted Answer Pending Moderation
  1. Thursday, 23 September 2021 15:30 PM UTC
  2. PowerBuilder
  3. # 3

Hi Arcady,

If your .NET DLL does not comply with the importer requirements then you must create a wrapper .NET DLL that is mapping to what the importer requires. There is a good Elevate presentation on this topic: https://www.appeon.com/conference/elevate-2020/live?id=251

Yes, it is not 100% automatic, but it is going to get you off of OLE.  We do not plan to change the approach that wrappers are required.

Best regards,
Armeen

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.