Invoke User Procedure (UDP) (Magic xpa 2.x)
The Invoke User Procedure is used to invoke the execution of a 3rd generation language program and to pass arguments. It is often used to call Windows DLLs. Magic xpa uses the 'C' language calling convention when calling this program. The call is done in memory as if the user procedure is an internal subroutine of Magic xpa, using the simplest call or jump instruction of the machine.
You can use the Invoke User-Defined Procedure operation to:
-
Implement Magic xpa extensions, which are user-supplied routines that perform specific tasks or functions not supported internally in Magic xpa
-
Utilize within Magic xpa existing code written outside of Magic xpa
-
Implement specialized calculations that have been optimized for speed in the external procedure
-
Note that when you use Invoke UDP, you are communicating at the lowest level. This means that you might have to format data more carefully, and case matters.
-
The best way to send a Null to a UDP is to use the BufSetAlpha function.
-
After you have selected the expression, the first part of its text appears in the Name column, for display only. For example, if you are calling the Set Focus function, @user32.setForegroundWindow is displayed.
-
Only the return value will be returned to Magic xpa. Any modifications made to the variables sent will not be reflected in Magic xpa.
The properties of the Invoke User-Defined Procedure operation are:
UDP
Arguments – See Invoke UDP Argument Example
Convention
Condition
Invoke Operations
How Do I Call a DLL Function?
The Online and Rich Client Samples projects (program CN16 and RCN16)