CustomProcess_SetCallbackFunctions Function

Applies To: Implementing a custom process

Sets the function pointers for the callback functions that can be used by the custom process.

[C++]

 /// Typedefs for callback functions used.

 typedef const unsigned char* (*tGetRowfn)(void* processObject, unsigned long rowIndex);

 typedef char* (*tGetPropertyfn)(void* processObject, char* propertyName);

 typedef void* (*tCreateAuxRasterfn)(void* processObject, char* rasterID, BOOL resample);

 typedef const unsigned char* (*tGetAuxRowfn)(void* processObject, char* rasterID, 

 unsigned long rowIndex);

 

 CustomProcess_API BOOL __stdcall CustomProcess_SetCallbackFunctions(

    void* clientHandle, void* callbackObject, tGetPropertyfn getPropertyfn,

    tGetRowfn getRowfn, tCreateAuxRasterfn createAuxRasterfn, tGetAuxRowfn getAuxRowfn);

 

Arguments

[in] clientHandle

Unique ID used to identify the caller.

[in] callbackObject

Object used as first argument to the callback functions.

[in] getPropertyfn

Function used to request a special Property from the Process.

[in] getRasterMetadatafn

Function used to request metadata from the next Raster.

[in] getRowfn

Function used to request and Input row.

[in] createAuxRasterfn

Function used to request the image server to create an auxilary raster.

[in] getAuxRowfn

Function used to request a row of pixels from an auxilary raster.

Return Value

Signifies success or failure.

Reporting errors and warnings: Any errors can be obtained by calling the GetLastError function which will give out the error message for the last error in the DLL.

Example

The following example represents a partial C++ implementation of this function:

[C++]

/// Typedefs for callback functions used.

typedef const unsigned char* (*tGetRowfn)(void* processObject, unsigned long rowIndex);

typedef char* (*tGetPropertyfn)(void* processObject, char* propertyName);

typedef void* (*tCreateAuxRasterfn)(void* processObject, char* rasterID, BOOL resample);

typedef const unsigned char* (*tGetAuxRowfn)(void* processObject, char* rasterID, unsigned long rowIndex);

 

CustomProcess_API BOOL __stdcall CustomProcess_SetCallbackFunctions(

    void* clientHandle, void* callbackObject, tGetPropertyfn getPropertyfn,

    tGetRowfn getRowfn, tCreateAuxRasterfn createAuxRasterfn, tGetAuxRowfn getAuxRowfn)

{

    ClientHandle* myClientHandle = (ClientHandle*)clientHandle;

    myClientHandle->myCallbackObject = callbackObject;

    myClientHandle->myGetPropertyfn = getPropertyfn;

    myClientHandle->myGetRowfn = getRowfn;

    myClientHandle->myCreateAuxRasterfn = createAuxRasterfn;

    myClientHandle->myGetAuxRowfn = getAuxRowfn;

    return TRUE;

}

For a detailed example on how to implement this function, see Sample custom process.

Related Topics

See also: CustomProcess_Create, CustomProcess_SetWindow, CustomProcess_Initialize, CustomProcess_GetRow, CustomProcess_GetMetadata, CustomProcess_GetLastError, CustomProcess_Cleanup, CustomProcess_SetAreaOfInterest, CustomProcessUI_Init, CustomProcessUI_ShowModalDialog, CustomProcessUI_GetUpdatedXML, CustomProcessUI_GetStatus, CustomProcessUI_GetProperty, CustomProcessUI_SetProperty, CustomProcessUIForm_GetUpdatedXML, CustomProcessUIForm_Init