1. Michael Connell
  2. PowerServer
  3. Tuesday, 7 September 2021 13:00 PM UTC

Hi,

We're upgrading a legacy PB application to PowerServer 2021.

In the application Handle(GetApplication()) = 0 is used to determine if the application is being run from the PB IDE.

Unfortunately when running the new PowerServer project from the PB IDE this technique does not work since a valid handle is returned.

Is there a way to duplicate this technique i.e. is there any way to determine if we're running the installable web app from the PB IDE or not?

Regards,

Mike.

Armeen Mazda @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 7 September 2021 16:17 PM UTC
  2. PowerServer
  3. # 1

Hi Michael,

A PowerServer application cannot be run from the IDE.  There is shortcut in the IDE to make it convenient to launch your app, but its not really running from the IDE.

But we have added function so your PowerScript code knows when it is executing as client/server vs. PowerServer: https://docs.appeon.com/pb2021/powerscript_reference/ch02s04s461.html

Best regards,
Armeen

Comment
  1. Chris Pollach @Appeon
  2. Tuesday, 7 September 2021 16:58 PM UTC
Armeen is correct. Your App needs to use the new "IsPowerServerApp" method to check for this.
  1. Helpful
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Tuesday, 7 September 2021 13:41 PM UTC
  2. PowerServer
  3. # 2

Call the Windows API function GetModuleFileName. If it returns PB210.EXE then you are running from the IDE.

 

https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-getmodulefilenamew

 

Comment
There are no comments made yet.
Michael Connell Accepted Answer Pending Moderation
  1. Thursday, 9 September 2021 07:13 AM UTC
  2. PowerServer
  3. # 3

Guys,

Thank you very much for your suggestions. I will try both and see how it goes!

Regards,

Mike.

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.