Progress
External Program
Interfaces
Examples
The following procedure uses the Progress MESSAGE statement to display a message in an alert box. It then calls the
MessageBoxA
routine fromuser32.dll
to display the same message in an identical alert box:
The following procedure uses the
sndPlaySoundA
routine fromwinmm.dll
. The procedure allows the user to select a sound to play and then invokes the DLL routine to play the sound. The DLL routine takes two input parameters and returns a status code:
NOTE: You must have a sound driver installed on your machine to play sounds.The following code sample demonstrates calling the C library function “atoi” to get the value of the character form of an integer. The declaration of the C function being called looks like this:
int atoi(const char *str):
The following procedure defines and displays a shaded ellipse in the current window using DLL functions from the Windows graphics library. This requires initialization of a small structure (ElipRegion).
Note that Progress has no knowledge of any graphics that you create using DLLs. You must ensure that Progress does not refresh the window you are using while the graphics are displayed. Otherwise, the graphics disappear during a window system refresh. (You can help to mitigate this by providing a graphics refresh option within your Progress application.) This procedure displays a preparatory message (“Preparing drawing”), and pauses to realize the current window before calling the DLL routines that display the filled ellipse. The procedure pauses by default before it terminates, allowing the ellipse to remain on the display:
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |