How can I launch other application from PowerBuilder and wait until the launched application terminates before continuing?

I need to write function launches the application specified by
StringParameter with the command line parameters. The function should wait
until the launched application terminates before continuing. How can I do it
using PowerBuilder and Windows API ?


mail: igorm@proactivityinc.com


0
Igor
8/13/2000 2:00:20 PM
sybase.powerbuilder.general 62418 articles. 17 followers. Follow

5 Replies
1084 Views

Similar Articles

[PageSpeed] 12

In article <i6rNFfSBAHA.203@forums.sybase.com>, igor@proactivityinc.com 
says...
> I need to write function launches the application specified by
> StringParameter with the command line parameters. The function should wait
> until the launched application terminates before continuing. How can I do it
> using PowerBuilder and Windows API ?
> 
You can either pass the string to the Run() function or you can use Run() 
to kick off a batch or cmd file that does the actual starting of the 
application.  You'd then have to structure the batch to signal that it is 
done and have PB read that signal , it could be a dummy file that gets 
created that PB looks for in the do/while loop
-- 

Andy Turiansky [TeamSybase]
Check out SDN @  http://sdn.sybase.com
0
Andy
8/13/2000 1:29:26 PM
On Sun, 13 Aug 2000 16:00:20 +0200, "Igor Makhlin"
<igor@proactivityinc.com> wrote:

>
>I need to write function launches the application specified by
>StringParameter with the command line parameters. 
Use ShellExecuteA API call.
FUNCTION long ShellExecuteA( ulong hWnd, string Operation, string
lpFile, string lpParameters, string lpDirectory, int nShowCmd )
LIBRARY "shell32.dll"
 
>The function should wait
>until the launched application terminates before continuing. How can I do it
>using PowerBuilder and Windows API ?
Need more info.  What kind of applications you are starting?


  Boris Gasin [TeamSybase]
  mailto:bgasin@dynamictechgroup.com
    ___ 
  ____   _      
 _____    _     
  ____   _      
    ___ 


  Dynamic Technology Group, Inc.
  http://www.dynamictechgroup.com/
0
Boris
8/13/2000 1:30:30 PM
The LONG returned from the ShellExecuteA call, if greater than 32, should be
the 'hinstance' of the started app.  You could also setup a call to
CreateProcess() which is a bit harder as it requires a couple of structures
passed in. (We use CreateProcess in a DLL we built with C++).
CreateProcess() returns a 'Process handle' in one of the structures.

Using the HINSTANCE or PROCESS HANDLE, you can call one of the WaitFor...()'
functions.  Below is WaitForSingleObject(), which waits for the process to
terminate.

    DWORD WaitForSingleObject(
    HANDLE hHandle, // handle of object to wait for
    DWORD dwMilliseconds  // time-out interval in milliseconds
   );

hHandle is the HINSTANCE or PROCESS HANDLE or application handle as
determined by other functions using other names. <smile>

The value of dwMilliseconds given in the help file can be 'INFINITE', which
must be -1 but not sure, 0 checks and returns immediately, the number of
milliseconds otherwise.

CAVEAT: These functions don't like to be chained.  If the app you launch
will itself launch and wait for other apps, (e.g. installer apps), the
function will return when the first app goes into *its* wait state...

HTH

--

Steven M Field
mailto:scionyx@compuserve.com



"Boris Gasin [TeamSybase]" <NOSPAM_bgasin@dynamictechgroup.com> wrote in
message news:nh8dpscpcpgfjq6d08gttd9bj0dtb4cj5a@4ax.com...
> On Sun, 13 Aug 2000 16:00:20 +0200, "Igor Makhlin"
> <igor@proactivityinc.com> wrote:
>
> >
> >I need to write function launches the application specified by
> >StringParameter with the command line parameters.
> Use ShellExecuteA API call.
> FUNCTION long ShellExecuteA( ulong hWnd, string Operation, string
> lpFile, string lpParameters, string lpDirectory, int nShowCmd )
> LIBRARY "shell32.dll"
>
> >The function should wait
> >until the launched application terminates before continuing. How can I do
it
> >using PowerBuilder and Windows API ?
> Need more info.  What kind of applications you are starting?
>
>
>   Boris Gasin [TeamSybase]
>   mailto:bgasin@dynamictechgroup.com
>     ___
>   ____   _
>  _____    _
>   ____   _
>     ___
>
>
>   Dynamic Technology Group, Inc.
>   http://www.dynamictechgroup.com/


0
Steven
8/13/2000 9:00:31 PM
You can also use the CreateProcessA API. This call gives you a process-id you
can use with other Windows API's to check if the process is still running.
Works quite well. For an example, see:
http://utopia.knoware.nl/users/cypr115/PB/tips/pbtip32.htm

Aart Onkenhout, AINO Informatiesystemen, The Netherlands.

Igor Makhlin schreef:

> I need to write function launches the application specified by
> StringParameter with the command line parameters. The function should wait
> until the launched application terminates before continuing. How can I do it
> using PowerBuilder and Windows API ?
>
> mail: igorm@proactivityinc.com

0
Aart
8/14/2000 5:56:55 AM
You might also try the following from Eric Aling's web site.

Check out the link and download from the following:

http://utopia.knoware.nl/users/cypr115/PB/tips/pbtip32.htm

I used it for running DBISQL and waiting till it finished.  It worked fine
on Win95, 98, and NT.


"Andy Turiansky" <andyt@delanet.com> wrote in message
news:MPG.14006cc16dfae0ac9896ed@forums.sybase.com...
> In article <i6rNFfSBAHA.203@forums.sybase.com>, igor@proactivityinc.com
> says...
> > I need to write function launches the application specified by
> > StringParameter with the command line parameters. The function should
wait
> > until the launched application terminates before continuing. How can I
do it
> > using PowerBuilder and Windows API ?
> >
> You can either pass the string to the Run() function or you can use Run()
> to kick off a batch or cmd file that does the actual starting of the
> application.  You'd then have to structure the batch to signal that it is
> done and have PB read that signal , it could be a dummy file that gets
> created that PB looks for in the do/while loop
> --
>
> Andy Turiansky [TeamSybase]
> Check out SDN @  http://sdn.sybase.com



0
Brad
8/14/2000 9:14:07 PM
Reply:

Similar Artilces:

How do you launch a PowerBuilder application from a browser?
I have a IE browser application where I want the user to be able to launch a PowerBuilder .exe and pass it a parameter. Anyone know how? Thanks. John Malaney Metavante Corp. 1-414-577-9081 Use a link like <a href="pbapp.exe parm">Run PB Application</a> or <A HREF="file:///C|/testprogram.exe -setup">run the prog</a> Just remember that all those prompts the user has to answer are necessary security against a bad person who might try <a href="format c:">Click here for a free gift!</a> HTH -EGM John Ma...

Powerbuilder application "crashing" another powerbuilder application
This is a repost of the above subject since there has been some problem for messages posted on the 19th - 22nd July 2002. *************** Hi All, I have an application (App A)built using PB7.0.3 build 10077 and it seems to work fine. However, recently, another application (App B) built using PB 7.0.3 build 10047 as well was installed and it seems to trigger Dr Watson on App A. There is an embedded OCX on a "main" window on App A, which receives triggers from external applications. The OCX will then call another function sitting on another main window. That function w...

PowerBuilder Application Execution Error (R0094) Application terminated.
Hi all, Do you know what is the problem of EAS server (3.61) , it generate error as below. I try to find out but fail. Regards, Frankie May 21 15:05:48 2002: Frankie *** Refreshing Product Catalog May 21 15:05:48 2002: ACTIVATE for n_product May 21 15:05:48 2002: BEGINNING refresh() May 21 15:05:49 2002: PB exception caught in tryInvoke May 21 15:05:49 2002: DESTRUCTOR for n_product May 21 15:05:49 2002: SystemException: INTERNAL (orderentry/n_product/refresh__L - <system>@0.0.0.0) May 21 15:05:49 2002: PowerBuilder Application Execution Error (R0094) Application t...

Powerbuilder Application Execution Error (R0006) Application terminated
I receive the following message in my Jaguar srv.log file. "Powerbuilder Application Execution Error (R0006). Application terminated." Question 1. Is this a generic error message or does it point to a specific reason. Question 2. First I will include these lines from srv.log leading up to and including the application error message. Item 1. **************************************************************************** **** Dec 05 09:35:02 2001: HTMLDW: Entering SetServerServiceClasses('n_sc_specimen;') Dec 05 09:35:02 2001: Constructor 09:35:02 Dec 05 09:35:02...

an application to launch external applications
Hi, I was wondering if it is easy (or even possible) to write a XUL application similar to the component bar (bottom right corner of the browser window) that would launch external applications. Thanks in advance. ...

Launch deployment application by Web Application
I want to launch a client form application by my Web application.What technology I have to use?Can you describe specifically about Launching No-Touch Deployment Applications?Thank a lot...

Deploying powerbuilder application as .NET web application
Hi when I deploy Client/Server PowerBuilder application as .NET Web application I get below output. Not even getting any bug messages. Checking IIS Server... Generating .NET assembly file... Deploy failed. Have deployed provided Tutorial application as Web application. It has successfully created and deployed. Any information is appreciated. If this question has to do with PB 11 WebForm deploys, you want to post it in the sybase.public.powerbuilder.net.webform section. This section is for DataWindow.Net, a different product. On 29 Jul 2008 05:32:55 -0700, Raju Gol...

migrating a powerbuilder application to a VB.Net application
I want to migrate an application built with powerbuilder to a VB.Net application. Someone is supposed to work on that application but the person can only work in the VB.Net environment.So i want to find out if there is a way of migrating my powerbuilder application to VB.Net Wrong newsgroup :-) <bernard>; <ghana> wrote in message news:46c6f6a8.1595.1681692777@sybase.com... >I want to migrate an application built with powerbuilder to > a VB.Net application. Someone is supposed to work on that > application but the person can only work in the VB.Net > envir...

applications launches out several times configured to launch out only once
Hello, I have applications �patchman� with many dependences which is played well on my PC but sometimes it is however played one second time it is configured to be played only once, can you help me? Poste XP SP2 Zen Agent ir6 Client novell 4.92 SP2 Sorry for my english :) Thierry, It appears that in the past few days you have not received a response to your posting. That concerns us, and has triggered this automated reply. Has your problem been resolved? If not, you might try one of the following options: - Do a search of our knowledgebase at http://support.novell.com/...

Powerbuilder application terminating abruptly
Hi All, I have an application built on PowerBuilder 10 and SQL Server 2005. One of the window in the application is used for entering customer data by the end users. In the whole application, this screen is of most importance. Recently, I added some new features in the window. Now, after entering 100+ records using the same window, the application terminates abruptly. The problem is that I am not able to able to replicate it at my end as it happens only after 100+ records are entered. I tried PBDEBUG debugging option but it's making the application very slow and the end users ...

OLE Application icons shown within a PowerBuilder application
Does anyone know how I can show the icon associated to an application that will be launched with a double click on a PB control? We are trying to offer the capability of attaching files in a PowerBuilder application and have been succesful on having the files stored in the database and from within PB launch the application, for example MS Word, Excel, etc. However, we would like to present the icon associated to the application that will be launched and don�t know how to do it. How can we do it? Any help, any idea will be appreciated. Thanks in advance ...

Application does not launch
To everyone out there I have deployed the application on the WDK Server. But when I try to launch the application I just get the WDK splash screen with the message 'Connection Established'. The application does not launch. Before the splash screen was displayed the WDK plugin installed successfully from the web page I created. Could someone please tell me if I am missing something. I would deeply appreciate it. The e-mail could be sent to gadiga@telcordia.com The html of the web page is as follows: <!doctype html public "-//w3c//dtd html 4.0 transitional//en...

PowerBuilder.Application
Hi, I try to use PowerBuilder.Application automation object in C++ with IDispatch interface but where can I find the DISPID of LibraryList, MachineCode, CreateObject members ? Thanks in advance Benoit. It's easiest to use the OLE call "GetIDsOfNames(...)". This remains version independent. Hope this helps, Reed Shilts PowerBuilder / PowerJ Kernel Group ***Nothing I Say Is Official*** Benoit ROUGE-PULLON wrote: > Hi, > > I try to use PowerBuilder.Application automation object in C++ with > IDispatch interface but where can I find the...

Application Launch
Hi, We have installed Client and Server components of WDK and configured launch file. When web link or desktop icon is clicked through browser, application gets started in the seprate window and not within the browser. Is this ok or we are missing something ? TIA Hemang. You are missing nothing... this is the way it works. -Greg Hemang Munshi wrote: > Hi, > We have installed Client and Server components of WDK and configured > launch file. When web link or desktop icon is clicked through browser, > application gets started in the seprate window and not withi...

Web resources about - How can I launch other application from PowerBuilder and wait until the launched application terminates before continuing? - sybase.powerbuilder.general

PowerBuilder - Wikipedia, the free encyclopedia
PowerBuilder is an integrated development environment owned by Sybase , a division of SAP . It has been in use since 1991, peaking around 1998 ...

Sybase PowerBuilder tool readied for Microsoft's .Net
... Win32 or newer style .Net development After several years of work, Sybase is ready to deliver on the final step in its plan to move PowerBuilder ...

Jim O'Neil (@jimoneil) on Twitter
Sign in Sign up To bring you Twitter, we and our partners use cookies on our and other websites. Cookies help personalize Twitter content, tailor ...

Open Directory - Computers: Programming: Languages
about dmoz - dmoz blog - report abuse/spam - help the entire directory only in Programming/Languages Description Top : Computers : Programming ...

The HP Booth Staff (Goons) Owe Me an Apology
... when you might need to use it. For instance, when I was in the WinRunner world there were plugins for driving terminal emulators and powerbuilder ...

Contact Us - Sybase Inc
Thanks for visiting the 主页 section of Sybase.com. Here you will find information about Contact Us. For more information about Business Intelligence, ...

热门搜索 - 我的异常网
... 我的异常网 » 热门搜索 sdpnet2 移动【A111】其它用户原因鉴权失败,是什么意思啊 http:// 192.168.1.102:22578 本网站服务器位于美国,受美国法律保护 MiniUI js 破解 http://192.168.1.103:8080/ powerbuilder ...

Mobile app security: Always keep the back door locked
The best way to keep mobile apps safe is to secure the services they connect to.

10 Tech Skills That Will Instantly Net You A $100,000+ Salary
... that let's developers run Java applications. Java is highly popular language for writing web apps and custom enterprise apps. No. 8: PowerBuilder ...

Top Ranked Articles
Top Ranked Articles - Free source code and tutorials for Software developers and Architects.; Updated: 23 Feb 2013

Resources last updated: 12/17/2015 11:07:30 PM