Important: The information in this document is obsolete and should not be used for new development.
CallComponentFunctionWithStorage
TheCallComponentFunctionWithStorage
function invokes a specified function
of your component with the parameters originally provided by the application that called your component. You pass these parameters by specifying the same component parameters record that was received by your component's main entry point. TheCallComponentFunctionWithStorage
function also provides a handle to the memory associated with the current connection.
FUNCTION CallComponentFunctionWithStorage (storage: Handle; params: ComponentParameters; func: ComponentFunction): LongInt;
storage
- A handle to the memory associated with the current connection. The Component Manager provides this handle to your component along with the request.
params
- The component parameters record that your component received from the Component Manager.
func
- The address of the function that is to handle the request. The Component Manager calls the routine referred to by the
func
parameter as a Pascal function with the parameters that were originally provided by the application. These parameters are preceded by a handle to the memory associated with the current connection. The routine referred to by thefunc
parameter must return a function result of typeComponentResult
(a long integer) indicating the success or failure of the operation.DESCRIPTION
TheCallComponentFunctionWithStorage
function returns the value that is returned by the function referred to by thefunc
parameter. Your component should use this value to set the current error for this connection.SPECIAL CONSIDERATIONS
CallComponentFunctionWithStorage
takes as a parameter a handle to the memory associated with the connection, so subroutines of a component that don't need global data should use theCallComponentFunction
routine described in the previous section instead.If your component subroutine requires a handle to the memory associated with the connection, you must use
CallComponentFunctionWithStorage
. You allocate the memory for a given connection each time your component is opened. You inform the Component Manager that a connection has memory associated with it by calling theSetComponentInstanceStorage
procedure.SEE ALSO
For an example that usesCallComponentFunctionWithStorage
,
see Listing 6-5 on page 6-16. Use theSetComponentInstanceError
procedure, described on page 6-67, to set the current error for a connection. A description of theSetComponentInstanceStorage
procedure is given next.