1. Aron Cox
  2. SnapDevelop
  3. Wednesday, 1 July 2020 10:07 AM UTC

So I have a C# dll I am already calling from PowerBuilder by compiling it as an Active/X control. Most calls return a class containing a number of variables and the PowerBuilder .Net Dll Importer can't handle these, ignoring them completely.

So this leads me to a couple of questions:

1. WIll the .Net Dll Importer ever handle these? If so, I will wait. I really like the idea of stepping into the C# code from PowerBuilder while debugging, hence the internest in SnapDevelop

2. If not, then I've heard I could wrap the calls in another dll. I have tested this and it works but it's not elegant. Is this the way to do it? Does anyone have a better way?

Here's how I have tested:

I take the call and change it to a void and instead of returning the result, store it in an instance variable. Then for each type in the returned class I create a method to return the value, so I end up with something like

private MyResultClass _result

public void MyMethod(string arg1, string arg2)

{

   . ..do some stuff


 _result = result;

}

public Boolean ResultSuccess()

{

   return _result.Success;

}

public String ResultMsg()

{

   return _result.Msg;

}

Then in the PowerBuilder code I have to call MyMethod, then call each of ResultSuccess and ResultMsg and put them into a PowerBuilder structure. I could probably write a generator to do all of this but it seems a bit inelegant.

The only other way I can think of is to serialise the result to XML, return it as a string and then extract it from the XML somehow. As far as I know there isn't an XML to Structure import in PowerBuilder. I can import to a datastore but I'm not sure that really helps all that much.

Any ideas are welcome.

Thanks!

 

Govinda Lopez @Appeon Accepted Answer Pending Moderation
  1. Monday, 6 July 2020 19:13 PM UTC
  2. SnapDevelop
  3. # 1

Aron,

 

Regarding your question:

 

1. WIll the .Net Dll Importer ever handle these? If so, I will wait. I really like the idea of stepping into the C# code from PowerBuilder while debugging, hence the interest in SnapDevelop

 

Please open a support ticket as an enhancement request. We can then pass it to our Product team for consideration.

 

 

Regards,

Comment
There are no comments made yet.
Govinda Lopez @Appeon Accepted Answer Pending Moderation
  1. Monday, 6 July 2020 18:28 PM UTC
  2. SnapDevelop
  3. # 2

Hi Aron,

 

How about using JSON instead? That is supported by PowerBuilder and C#.

 

 

Regards,

Comment
  1. Govinda Lopez @Appeon
  2. Monday, 6 July 2020 19:15 PM UTC
Here's another idea:



How about publishing your code as RESTful Web API's? PowerBuilder can consume RESTful Web Services with it's latest versions.
  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.