SetProgressCallback

Events, DLL interface

Description

Registers a DLL progress callback for the selected PDFlibPas instance

The callback receives progress notifications from long-running operations that report the same values exposed by the Delphi OnProgress event

Syntax

DLL

typedef int (__stdcall *DLPDFlibProgressProc)(int Percent, void * UserData);
int DLSetProgressCallback(int InstanceID, DLPDFlibProgressProc ProgressProc, void * UserData);

Parameters

InstanceIDThe PDFlibPas instance returned by CreateLibrary. Use 0 only for the implicit default instance
ProgressProcA stdcall callback pointer that receives Percent and UserData. Pass NULL when the application no longer needs callback notifications
UserDataAn application-defined pointer passed back to ProgressProc without interpretation by PDFlibPas

Return values

0The instance was not found
1The callback pointer and user data were stored for the instance

Remarks

Keep the callback lightweight and avoid re-entering PDFlibPas from inside the callback