Skip to content

IGR_Close_File

Description

IGR_Close_File releases the resources associated with the file handle. It must be called for every document opened by IGR_Open_File.

Prototype

IGR_LONG IGR_Close_File(
    IGR_LONG DocHandle,
    Error_Control_Block* ISYSError);

Parameters

DocHandle: IGR_LONG

Handle to a document, opened by a call to IGR_Open_File, IGR_Open_File_Ex, IGR_Open_Stream or IGR_Open_Stream_Ex.

ISYSError: Pointer to Error_Control_Block

Returns error details if the call fails.

Return value

Success: IGR_LONG

Returns IGR_OK.

Failure: IGR_LONG

Returns one of the possible IGR_E error codes.

Sample code

Error_Control_Block ISYSError;
IGR_LONG Capabilities, DocType, DocHandle;

IGR_LONG RC = IGR_Open_File(_UCS2("TEST.DOC"), IGR_BODY_AND_META, &Capabilities, &DocType, &DocHandle, &ISYSError);
if (RC == IGR_OK)
{
    // Extract document text or sub-documents...
    IGR_Close_File(DocHandle, &ISYSError);
}

Additional information

The stream must be created by one of the IGR stream creation functions or a custom IGR stream that has been opened.