LAnnContainer::LoadOffset

#include "ltwrappr.h"

virtual L_INT LAnnContainer::LoadOffset(fd, nOffset, nLength, pLoadFileOption)

L_INT fd;

/* the Windows file handle */

L_INT32 nOffset;

/* position of the first byte to load */

L_UINT32 nLength;

/* number of bytes of annotation data to read */

pLOADFILEOPTION pLoadFileOption;

/* pointer to a LOADFILEOPTION structure */

Loads annotations from a position within a file. This enables you to load an annotation file that is embedded in another file. This function is available in the Document/Medical Toolkits.

Parameter

Description

fd

The Windows file handle of the file to load.

nOffset

The position, from the beginning of the file, of the first byte to load. (The byte count starts at zero.)

nLength

The number of bytes of annotation data to read from the file. If you saved the offset using LAnnContainer::SaveOffset, the variable pointed to by puSizeWritten in that function contains the length of data saved. If you do not know the length of the data, pass 0xFFFFFFFF for this parameter.

pLoadOptions

Pointer to the LOADFILEOPTIONstructure to be updated with the current extended values.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Required DLLs and Libraries

LTANN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

LAnnContainer::DeletePage, LAnnContainer::DeletePageMemory, LAnnContainer::DeletePageOffset, LAnnContainer::FileInfo, LAnnContainer::FileInfoMemory, LAnnContainer::FileInfoOffset, Class Members, LAnnotation::GetOptions, LAnnotation::SetOptions

Topics:

Annotation Functions: Input and Output

 

Implementing Annotations

 

New Annotation Features of Version 14.5

Example

L_VOID TestLoadSaveOffset(LAnnContainer& LeadAContainer)
{
   HFILE OffsetFile; // File handle
   L_UINT32 ulSizeWritten; // Variable to be updated with the size written

   // Create a file
#ifdef UNICODE

   OffsetFile = _wcreat(TEXT("TOFFSET.ANN"), 0);
#else 

   OffsetFile = _lcreat("TOFFSET.ANN", 0);
#endif
   // Write header information -- 29 characters and a terminator
   _lwrite(OffsetFile, "This is a 29-character string", 30);

   // Save the file with an offset
   ulSizeWritten = LeadAContainer.SaveOffset(OffsetFile, 30, ANNFMT_NATIVE, FALSE);

   // Close the file
   _lclose(OffsetFile);

   /* Loading */

   // Open the file and get the file handle
#ifdef UNICODE

   OffsetFile = _wopen(TEXT("TOFFSET.ANN"), OF_READ|OF_SHARE_DENY_WRITE );
#else

   OffsetFile = _lopen("TOFFSET.ANN", OF_READ|OF_SHARE_DENY_WRITE );
#endif
   // Load the file with a 30-byte offset
   LeadAContainer.LoadOffset(OffsetFile, 30, ulSizeWritten, NULL);

   // Close the file
   _lclose(OffsetFile);
}