1. Hirenkumar Lad
  2. PowerBuilder
  3. Thursday, 5 May 2022 09:26 AM UTC

Dear Support Team,

Can I set the Runtime folder path for the Assembly (dll file created using Power Builder)? The way we are setting the Runtime folder path in XML file for the EXE project.

Thanks & Regards,

Hiren Lad

Accepted Answer
Mark Lee @Appeon Accepted Answer Pending Moderation
  1. Monday, 9 May 2022 07:20 AM UTC
  2. PowerBuilder
  3. # Permalink

Hi Hirenkumar,

 

.NET Assembly target doesn't support setting the runtime folder path with an XML file. Please refer to https://community.appeon.com/index.php/qna/q-a/net-assembly-required-dlls-not-found for a solution.


BTW, the .NET Assembly target is an obsolete feature since version 2019. Therefore, it will not be enhanced to support setting the runtime folder path with an XML.

 

Regards,

Comment
There are no comments made yet.
Hirenkumar Lad Accepted Answer Pending Moderation
  1. Friday, 6 May 2022 07:35 AM UTC
  2. PowerBuilder
  3. # 1

Hi miguelL,

It is not about the DLL import in Power Builder Application. Let me specify the requirement in details.

  • I have developed the Power Builder application which produce the output as DLL. So that I have selected the Target as .NET Assembly
  • After that, I have added that DLL as a reference in .NET WinForms  application. As I want to call the Power Builder function in .NET WinForms Application.

As I am using the Power Builder generated DLL in my .NET WinForms application, obviously I need to place PB runtime files into bin/debug folder of the .NET WinForms application then and only WinForms application will work without any error. 

Problem here is I have to copy all the files and folders of Runtime folder and placed in to bin/debug folder of the .NET WinForms application. Alternative is available for target as Application in Power Builder. In which xml file is generated with name of EXE name and where we have the "<RuntimePath>" node and Exe application refer the runtime from path specified in XML. 

Now let me come to the question that Do we mechanism for .NET Assembly project (target as .NET Assembly) where we can specify the Path of the Runtime folder?

Comment
  1. Miguel Leeuwe
  2. Friday, 6 May 2022 07:40 AM UTC
Thanks for your explanation, I wouldn't know what advice to give you on this unless you could make a small sample app.

regards,

MiguelL
  1. Helpful
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Thursday, 5 May 2022 14:33 PM UTC
  2. PowerBuilder
  3. # 2

Hi,

When using the DLL import tool, there will be an instance variable of type string which indicates a fixed path to the DLL. You should change it to a relative path.

For example, if you distribute your DLL into a subfolder of where your EXE file is:

is_..... = ".\MyDLLFolder\My.DLL"

To be able to run the application from the pb IDE, you would have to have a subolfer "MyDllFolder" in the same folder as where the PBL file with your application object is.

Another thing you could do, is test whether you're running from the IDE or EXE by using:

if Handle(GetApplication()) = 0 then
    // you are running from the IDE
else
    // your are running the EXE
end if

Or something similar to that, I can't access my PB right now, so I'm only guessing to the correct syntax.

Regards,

miguelL

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.