1. Arcady Abramov
  2. PowerBuilder
  3. Tuesday, 7 April 2020 06:19 AM UTC

Hello, support

There is no data in the help on how to import nested .NET classes into the PB 2019 R2.

If I have 2 classes:

Class 1: int prop1, int prop 2

Class 2: int prop3, Class1 prop4

 

then .NET loaded does not import prop 4. It does not make much sense, since Class 1 is imported fully.

Can someone point me to the article in help on how I can deal with this?

Thank you 

Arcady

Mark Lee @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 8 April 2020 08:00 AM UTC
  2. PowerBuilder
  3. # 1
Hi Arcady,
 
 
1. Currently the .NET assembly don't support the class as the return value of a function.
3. You can change your code about the Class 2 like that Class 2: int prop3, string prop4
 
Regards,
Comment
There are no comments made yet.
Michael Kramer Accepted Answer Pending Moderation
  1. Wednesday, 8 April 2020 07:20 AM UTC
  2. PowerBuilder
  3. # 2
  • PB Help
    • Application Techniques
      • Program Access Techniques
        • Calling .NET Assembly in an Application
          • About .NET assembly

That section including sub sections on Data types, Classes, and more give you restrictions on current implementation.

Back in the days of SOAP web services I was used to passing complex, nested data structures as serialized XML. These days I use serialized JSON because it is much more compact.

For one of my .NET assemblies I added "interop" classes doing nothing but relaying data between simple data types (more parameters) and complex classes (fewer parameters)

HTH /Michael

Comment
  1. Arcady Abramov
  2. Wednesday, 8 April 2020 08:39 AM UTC
Hello, Michael

Can you provide an example of such a type and the way it used?

I man ot sure I follow
  1. Helpful
  1. Michael Kramer
  2. Wednesday, 8 April 2020 19:22 PM UTC
Hi Arcady, Let me publish code from my beta test in a separate reply so you get syntax highlights.
  1. Helpful
  1. Arcady Abramov
  2. Saturday, 11 April 2020 07:24 AM UTC
Hello, Michael

Can you publish your code, please?



Thank you
  1. Helpful
There are no comments made yet.
Ricardo Jasso Accepted Answer Pending Moderation
  1. Tuesday, 7 April 2020 22:47 PM UTC
  2. PowerBuilder
  3. # 3

Arcady,

This version of the .NET Library importer (and the new DotNetObject object) doesn't support complex data types, either as properties or as arguments to functions. It's documented somewhere in the help. I replicated your scenario and got the same result.

You can view the list of the items that could not be imported by clicking the link "View Failed Items" in the .NET DLL Importer dialog window. 

From my experience, third party libraries tend to offer a simple API to access its functionality, for things like email, ftp, sockets, unit conversion, etc. Nevertheless, I expect Appeon will expand the capabilities of the importer in the future if demand arises.

Regards,

Ricardo

 

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 7 April 2020 22:04 PM UTC
  2. PowerBuilder
  3. # 4

Hi Arcady;

   The .Net "Importer" imposts a .Net "Assembly". Which in turn, can contain multiple classes. Is this what you are trying to do? In other words, are your two classes already in one  .Net assembly together?

Regards ... Chris

Comment
  1. Arcady Abramov
  2. Wednesday, 8 April 2020 08:44 AM UTC
Yes,

I have an assembly which handles complex communications between different systems.

Simple data types are nowhere near enough for this. We need a way to pass and return classes, otherwise the whole thing is almost pointless.
  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.