Calling external libraries from procedures
270
In these statements, function_name is the name of a function in the dynamic
link library, and library.dll is the name of the library. The arguments in the
procedure argument list must correspond in type and order to the arguments for
the library function; they are passed to the external DLL function in the order
in which they are listed. Any value returned by the external function is in turn
returned by the procedure to the calling environment.
No other statements
permitted
A procedure that calls an external function can include no other statements: its
sole purposes are to take arguments for a function, call the function, and return
any value and returned arguments from the function to the calling environment.
You can use IN, INOUT, or OUT parameters in the procedure call in the same
way as for other procedures: the input values get passed to the external
function, and any parameters modified by the function are returned to the
calling environment in OUT or INOUT parameters.
External function declarations
When an external function is called, a stack is fabricated with the arguments
(or argument references in the case of INOUT or OUT parameters) and the
DLL is called. Only the following data types can be passed to an external
library:
•
CHARACTER data types, but INOUT and OUT parameters must be no
more than 256 bytes in length
•
SMALLINT and INT data types
•
REAL and DOUBLE data types
This section describes the format of the function declaration.
For information about passing parameters to external functions, see “How
parameters are passed to the external function” on page 271
In the external library, function declarations should follow these guidelines:
•
Windows NT
The function declaration should be of the following form
for the Watcom C/C++ compiler:
return-type * __export __stdcall function-name(
argument-list )
and the following form for Microsoft Visual C++:
return-type * __declspec(dllexport) __stdcall
function-name( argument-list )
Summary of Contents for Adaptive Server IQ 12.4.2
Page 1: ...Administration and Performance Guide Adaptive Server IQ 12 4 2 ...
Page 16: ...xvi ...
Page 20: ...Related documents xx ...
Page 40: ...Compatibility with earlier versions 20 ...
Page 118: ...Troubleshooting startup shutdown and connections 98 ...
Page 248: ...Importing data by replication 228 ...
Page 306: ...Integrity rules in the system tables 286 ...
Page 334: ...Cursors in transactions 314 ...
Page 396: ...Users and permissions in the system tables 376 ...
Page 438: ...Determining your data backup and recovery strategy 418 ...
Page 484: ...Network performance 464 ...
Page 500: ...System utilities to monitor CPU use 480 ...
Page 514: ...Characteristics of Open Client and jConnect connections 494 ...
Page 536: ...Index 516 ...