ImageGear for C and C++ on Windows v19.6 - Updated
IG_mpi_CB_set
API Reference Guide > Core Component API Reference > Core Component Functions Reference > Multi Page Image Functions > IG_mpi_CB_set

Use this function to call code that associates the given multi-page image hMIGear with any lpPrivate data, and updates the defined function.

Declaration:

 
Copy Code
AT_ERRCOUNT ACCUAPI  IG_mpi_CB_set( 
        [IN] HMIGEAR hMIGear, 
        [IN] LPVOID lpPrivate,
        [IN] LPFNIG_MPCB_UPDATE lpfnUpdate,
        [OUT] LPDWORD lpdwCBID, 
);

Arguments:

Name Type Description
hMIGear HMIGEAR The handle to the allocated multi-page image.
lpPrivate LPVOID Any private data.
lpfnUpdate LPFNIG_MPCB_UPDATE The pointer to the update function.
lpdwCBID LPDWORD Indicates where to return the ID of the associated callback data.

Return Value:

Returns the number of ImageGear errors that occurred during this function call. If there are no errors, the return value is IGE_SUCCESS.

Supported Raster Image Formats:

All pixel formats supported by ImageGear for C and C++.

Sample:

None

Example:

 
Copy Code
HMIGEAR hMIGear;     /* handle to multi-page image */
AT_ERRCOUNT  nErrCount = IGE_SUCCESS; /* will hold returned error count */
LPVOID lpData;
LPFNIG_MPCB_UPDATE    lpUpdateFunc;
DWORD dwCBID;
 ...
nErrCount = IG_mpi_CB_set( hMIGear, (LPVOID)hMIGear, _MPWndUpdate, &dwCBID );
 ...
nErrCount = IG_mpi_CB_get( hMIGear, dwCBID, &lpData, &lpUpdateFunc );
 ...
}
VOID  ACCUAPI  _MPWndUpdate(
   DWORD          dwCBID,
   LPVOID         lpPrivate,     /* Private data passed in */
   AT_MODE        nMode,
   UINT           nPage,
   UINT           nCount
)
{
   switch( nMode )
   {
   case  IG_MPCBMODE_MPI_DELETE:
         ...
      break;
   case  IG_MPCBMODE_MPI_ASSOCIATED:
         ...
      break;
   case  IG_MPCBMODE_MPI_CLOSE:
         ...
      break;
         ...
   }
}       

Remarks:

Multi-page images allow you to notify the application about status changes. Use this function to call code that associates the given multi-page image hMIGear with any lpPrivate data, and updates the defined function. See LPFNIG_MPCB_UPDATE.