1. Subbiya Vasumoorthy
  2. PowerBuilder
  3. Tuesday, 29 October 2024 18:09 PM UTC

Hi Team,
We have a requirement to modify the printer settings, earlier tried calling WIN API from powerbuilder but for some reason it got failed, so decided to create a C# dll and to call it.

The C# dll works as expected and tested using console app. I created the dll build and published, imported into powerbuilder (version PB2022 R3 Build 3356, Runtime: 22.2.0.3356) using .net dll importer also verified that option "Encapsulate a DotNetAssembly object in each DotNetObject object" is checked. But received an error message "Error Number 58. Object Instance does not exists..."

 

The following settings are selected  in .csproj file
Target Framework: .NET Core 3.1
Output Type: Class library

COnfiguration: Release /Any CPU.
Advanced:  Language Version: C# latest Major Version (default)

Please tell me what I'm missing here. Thankyou.


Thanks,

Subbiya

Miguel Leeuwe Accepted Answer Pending Moderation
  1. Tuesday, 29 October 2024 21:29 PM UTC
  2. PowerBuilder
  3. # 1

Have you tried compiling the DLL as x86 (32 bit), instead of Any CPU?

Comment
There are no comments made yet.
Subbiya Vasumoorthy Accepted Answer Pending Moderation
  1. Tuesday, 29 October 2024 19:02 PM UTC
  2. PowerBuilder
  3. # 2

Hi Armeen,
The dll works in C# console app only not in PowerBuilder, we have other dlls which are also created in C# and it is working fine with the  configuration mentioned above when we call it from PowerBuilder. but this dll is not working.


Thanks,

Subbiya

Comment
There are no comments made yet.
Armeen Mazda @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 29 October 2024 18:52 PM UTC
  2. PowerBuilder
  3. # 3

So you mean it works when you run your app in the IDE?  The problem is only when you deploy the .EXE to your users it is not working?  Did you follow the instructions in the documentation? https://docs.appeon.com/pb2022r3/application_techniques/Deploying_.NET_assembly.html

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.