1. Kari Paukku
  2. PowerBuilder
  3. Friday, 23 February 2024 14:48 PM UTC

Hi,

My starting point is that I  have created a .DLL which I call from the application, running x64-bit mode.

In my development PC (Win11) everything works fine, when running the application either from the PB IDE or standalone from a separate folder.

But when I try to deploy the application to a clean x64 Win 11 pc, I get the error message "Bad runtime reference".

I have tried to resolve this issue for days without any noticeable success. 

Things I have done are made sure that there are C++ runtime files installed on the empty PC, together with Net framework, etc.)

Initially I expected the issue to be in the C# part that is the DLL, but now I'm starting to think that maybe the PBNI (C++) part is the issue.

While the DLL part is compiled in Visual Studio to be x64 the PBNI part I have to compile as x32, because otherwise I can't make the PBX and PBD files.

Would anyone know or be willing to take a wild guess what is going wrong?

Thanks,

Kari

 

 

 

 

Roland Smith Accepted Answer Pending Moderation
  1. Friday, 23 February 2024 18:50 PM UTC
  2. PowerBuilder
  3. # 1

Compile your PBNI project in both 32-bit and 64-bit. Use the 32-bit one for using 'Import PB Extension' to get the object into a library.

Then deploy the matching one with your exe. There is no need to re-import the 64-bit one into the library. The 'Import PB Extension' process only works in 32-bit.

 

Comment
  1. Roland Smith
  2. Friday, 23 February 2024 18:54 PM UTC
There is no need to generate a PBD if you import the PBNI object into a library.
  1. Helpful
  1. Kari Paukku
  2. Monday, 26 February 2024 00:39 AM UTC
Roland,

I have tried that but I get the error "

---------- Import PB Extension: (00:24:04)

Importing Error: The file is not a valid dll or pbx file.



But doing it the DLL->PBX->PBD route it creates the .PBD file.



While trying to work on this I managed to the DLL extension to work - sort of.

I had an earlier PBNI->PDB file complied with VS2019(?) and PB2019R3 and as the actual DLL offering the functionality doesn't have any new function call, everything works.



When compiling the PBNI part with hVS2022, it stops working with the error message "file or assembly not found"



I'm not a seasoned C++ programmer, so can't figure out what part is missing. As such, there should not be any changes to the PBNI source code, and it complies ok.



I think I will let this be for now - I have already spent quite a lot of time with it, so the workaround will do for now.

Will return later to this with fresh eyes.





  1. Helpful
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Wednesday, 28 February 2024 13:17 PM UTC
  2. PowerBuilder
  3. # 2

I have an example PBNI project called WinsockPBNI you can download from here to use as an example:

https://www.topwizprogramming.com/tools.html

 

Comment
  1. Kari Paukku
  2. Friday, 1 March 2024 08:00 AM UTC
Thanks, I'll give it a go and most likely will learn more about PBNI from it.
  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.