10.07.2015 Views

Converting a NEXRAD Rainfall Map into a Flood Inundation Map by ...

Converting a NEXRAD Rainfall Map into a Flood Inundation Map by ...

Converting a NEXRAD Rainfall Map into a Flood Inundation Map by ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

ased on a process handle (a programmatic reference to the application currentlyexecuting, a handle on the process id). Once created, the process handle is used towait for the running object to finish execution. In practice, to wait for the externalprogram to terminate, the program may use the WaitForSingleObject API call orthe Windows Scripting Host (WSH).The programmatic options for calling an external program from VisualBasic are briefly described below. As mentioned before, for Visual Basic 6, Shellcommand is the most recommended way for interfacing with an externalapplication (if it does not provide an object library to access its functionality). Inits general syntax the code statement returns a process object id that is stored in along integer variable. The Shell command then contains the pathname of the fileto be executed and the desired style of window for the execution. An example ofthe Shell statement in Visual Basic follows.lngPID = Shell("c:\...\MyTextFile.txt", vbNormalFocus)To wait for the external program to terminate, the program might use theWaitForSingleObject API. The WaitForSingleObject uses a process handlegenerated with the previous process id of the open process (the launched externalprogram).For Visual Basic.NET, the external call operation is done through theSystem.Diagnostics namespace which has a Process class that is used to launchexternal programs. The program needs to pass in the name of an executable file ora filename with an extension associated with an executable application. Thegeneral syntax is shown bellow:105

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!