API referenceReporting

rptGetVersion

rptGetLastError retrieves the most recent error — either

C
BOOL32 __stdcall rptGetLastError(TRPT Engine, PRptErrorInfoC Info);
BOOL32 __stdcall rptGetVersion(int32_t* Major, int32_t* Minor, int32_t* Patch);
Delphi
function rptGetLastError(const Engine: TRPT; Info: PRptErrorInfoC): LongBool; stdcall;
function rptGetVersion(Major, Minor, Patch: PInteger): LongBool; stdcall;

Purpose. rptGetLastError retrieves the most recent error — either a specific engine's own last recorded error, or (when Engine = nil) the calling thread's engine-*creation* ("boot") error, the only way to learn why rptCreateEngine itself failed since a failed creation returns no handle. rptGetVersion reports the compiled-in LumasReport engine version.

Description. Engine = nil always succeeds and returns the thread-local GBootError (which may itself be a "no error" sentinel if nothing has failed on this thread yet — RptOkError). A non-nil but invalid Engine handle still returns True with a synthesized RPT_E_BADHANDLE error filled into Info — "still give the caller something actionable" per an inline comment, rather than simply failing the call. A valid Engine returns Eng.Errors.GetLast — the engine's own real per-instance last-error slot, updated by every render/export/preview/print/plugin-load exception as documented above. rptGetVersion needs no engine or license at all — it's a pure compile-time-constant reporter (RPT_VER_MAJOR/MINOR/PATCH), and each of Major/Minor/Patch may independently be nil to skip that output.

Parameters.

ParameterDescription
Enginenil = the calling thread's boot (creation) error; a valid handle = that engine's own last error; an invalid non-nil handle = a synthesized RPT_E_BADHANDLE.
InfoOutput: the structured error (code, source, location, message, hint).
Major, Minor, Patch*(GetVersion only)* Each independently nilable.

Return value. rptGetLastError: True in effectively all cases (only a nil Info pointer or an internal exception returns False). rptGetVersion: True always (no failure path beyond an internal exception).

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
[return: MarshalAs(UnmanagedType.Bool)]
Area
Reporting
Category

Reporting

Exported names

rptGetVersion

String variants

The …A form takes UTF-8, …W takes UTF-16; a bare name aliases the ANSI form.

See working code

Worked examples — complete programs in ten languages.