1. Martin Mueller
  2. PowerBuilder
  3. Tuesday, 21 March 2023 10:01 AM UTC

Hi,

are there any windows restrictions about calling applications out of a powerbuilder app?

We have two problems:

1. Sending an email via OLE to Outlook works only once. When calling a second time, our app crashes. This behavior exists depending on the installed Outlook and/or Windows version.

2. calling an external app with run. For excample:

ls_string = 'cs_console.exe -f json -s stop'

li_ret = run( ls_string )

It only works once :(

Thanks in advance.

Martin

PB 2021 build 1509

Martin Mueller Accepted Answer Pending Moderation
  1. Wednesday, 22 March 2023 08:27 AM UTC
  2. PowerBuilder
  3. # 1

Hi CHris,

thanks for your reply.

Now I create a global mailSession when starting the app and it works fine. Thanks a lot!!!

The exe file will be called from a win 11 machine. I called the owner of the external programm, if there are any known restrictions.

to be continued :)

Comment
  1. Chris Pollach @Appeon
  2. Wednesday, 22 March 2023 11:42 AM UTC
Hi Martin;

That is awesome news ... Super glad that it's now working!

Have you hugged a DataWindow today? ;-)

Regards ... Chris
  1. Helpful
  1. Roland Smith
  2. Wednesday, 22 March 2023 14:54 PM UTC
My RunAndWait object allows you to get the return code from the external program, something the built in Run function doesn't do.
  1. Helpful 1
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Tuesday, 21 March 2023 12:30 PM UTC
  2. PowerBuilder
  3. # 2

When using OLE to work with Outlook, only connect once at startup and then disconnect once when exiting. Outlook doesn't like multiple connects.

The Run function doesn't wait for the external app to finish and the return code is meaningless. Try my RunAndWait object instead:

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

 

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 21 March 2023 11:40 AM UTC
  2. PowerBuilder
  3. # 3

Hi Martin;

  FWIW: in newer releases of Outlook (ms-office), App's in general become unstable when logging in/out of the mail system everytime they send emails. The fix was to change your PB Apps so that they only login to Outlook once per instantiation.

   As for calling multiple times any external app EXE, I have not encountered any such issues in Appeon PB 2017 through PB 2022.

  BTW: what MS-Windows version are your Apps using?

Regards ... Chris 

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.