1. Edgar Gorodetsky
  2. PowerBuilder
  3. Monday, 10 July 2023 18:55 PM UTC

Hello, 

We're utilizing "https://docs.appeon.com/pb2021/application_techniques/Calling_C_Assembly_in_an_Application.html"; sample of the PowerScript code that calls the C# assembly after the import, without encapsulating the DotNetAssembly object. While it works on a particular machine where the powerbuilder is installed via executable located on a network drive, it crashes when that same executable of deployed application is accessed via laptop pc (via VPN). Would you please advise what can be done to correct this issue.

Thank you

Edgar Gorodetsky Accepted Answer Pending Moderation
  1. Tuesday, 11 July 2023 16:39 PM UTC
  2. PowerBuilder
  3. # 1

Hello again,

Thank you for referral above.  In the example to set relative path (instead of the fixed one) in is_assemblypath variable, what is "gnv_app"?  Please advise.

Thank you

Comment
  1. Miguel Leeuwe
  2. Tuesday, 11 July 2023 16:48 PM UTC
"gnv_app.is_appdir" is a string variable assigned at app startup and contains the path to the EXE file. When running from the IDE, it contains the path to the PBT ( same as folder where the PBL with the application object) is.

regards
  1. Helpful
  1. Edgar Gorodetsky
  2. Tuesday, 11 July 2023 16:53 PM UTC
If we don't use PFC classes, could we just script without it? For example:



ls_currentDir = GetCurrentDirectory() // later we restore to the active/current (at this moment) directory.

if len(is_appdir) > 0 then

// is_appdir is where the EXE is (or pbt when running from the IDE)

ChangeDirectory ( is_appdir )

end if
  1. Helpful
  1. Miguel Leeuwe
  2. Tuesday, 11 July 2023 16:53 PM UTC
So the advantage of using a "relative" path is that as long as you have your DLL in the same folder structure, it can't fail on a fixed path not existing.

The disadvantage is that when you manipulate files (read/write), the internal windows directory (current directory) no longer points to where your executable is.

Therefore you store that directory right after opening the application, so you can always use it anywhere else in the application.
  1. Helpful
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Monday, 10 July 2023 23:35 PM UTC
  2. PowerBuilder
  3. # 2

I concur with Miguel, Edgar - There is NO need to ask a question more than once.

Please realize that Q&A responders are volunteers that try to help as their schedules allow. Also, a question on a topic that most developers have never experienced (like your question here) may take longer to get a response since the pool of Community members that have the needed experience is likely to be small.

In addition to the free Community Q&A forum, you always have the option of opening a paid Premium Support ticket with Appeon:

    https://www.appeon.com/premium-support.html

Best regards, John

Comment
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Monday, 10 July 2023 23:00 PM UTC
  2. PowerBuilder
  3. # 3
Comment
  1. Edgar Gorodetsky
  2. Tuesday, 11 July 2023 04:16 AM UTC
Yes, I did ask this same question on the older chat. I was not sure if it went through and I submitted it again here.
  1. Helpful
  1. Miguel Leeuwe
  2. Tuesday, 11 July 2023 04:29 AM UTC
Well, you've been getting answers on the previous one, so you must know "it went through".

regards

Once again: have a look at https://community.appeon.com/index.php/qna/q-a/running-net-extension-in-pb22
  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.