ILITWriter::Create

The Create method creates a new .lit file.

Syntax

HRESULT Create (
[in, string] const wchar_t* pwszLitFile,
[in, string] const wchar_t* pwszSourceBasePath,
[in, string] const wchar_t* pwszSource,
[in] int iMinimumReaderVersion
);

Parameters

pwszLitFile

The null-terminated output filename.

pwszSourceBasePath

The null-terminated pathname from which Litgen.dll should resolve relative links. In the context of an OEB publication, this would be the full pathname of the package file.

pwszSource

A null-terminated string containing the owner of the content, usually an author or publisher name.

iMinimumReaderVersion

The minimum version on which the .lit file should run.

0: run on all versions

1: run on all versions except the first Pocket PC ROM release

Return Values

S_OK

E_INVALIDARG

E_OUTOFMEMORY

E_UNEXPECTED

CO_E_NOTINITIALIZED

E_FAIL

Remarks

This method overwrites most target files without warning, including files with normal, archive, and offline bits set. Files with system, hidden, read-only bits set fail with E_FAIL.

You can set iMinimumReaderVersion to prevent older readers from opening books that render badly or cause other problems.  For example, the Pocket PC Reader contained a much weaker CSS parser than more recent versions. Some CSS constructs, particularly invalid CSS, cause that version to fail completely.  As a result, Litgen.dll refuses to build a book containing such constructs, unless this value is 1 or above.

See Also

© 2000 Microsoft Corporation. All rights reserved. Terms of use.