KVXMLStartOOPSession()

This function performs the following:

Syntax

BOOL pascal KVXMLStartOOPSession(
    void                *pContext,
    KVInputStream       *pInputStream,
    char                *pFileName,
    KVXMLTemplate       *pTemplates,
    KVXMLOptions        *pOptions,
    KVXMLTOCOptions     *pTOCCreateOptions
    DWORD               *pPID,
    KVErrorCode         *pError
    DWORD                dwOptions,
    void                *pReserved1,
    void                *pReserved2 );

Arguments

pContext

A pointer returned from fpInit() or fpInitWithLicenseData().

pInputStream

A pointer to the developer-assigned instance of KVInputStream. The KVInputStream structure defines the input stream containing the source for the conversion.

If pInput is defined, pFileName must be NULL. The input data can be defined as a data stream or file, but not both.

pFileName

A pointer to the file to be converted. The file must exist on the same file system as the Servant.

If pFileName is defined, pInput must be NULL. The input data can be defined as a data stream or file, but not both.

pTemplatesEx

A pointer to the KVXMLTemplate data structure. It defines the overall structure of the output. Individual elements within the structure define the markup written at specific points in the output stream. See KVXMLTemplate.

If this pointer is NULL, the default values for the structure are used.

pOptionsEx

A pointer to the KVXMLOptions data structure. It defines the options that control the markup written in response to the general style and attributes (font, color, and so on) of the document. See KVXMLOptions.

If this pointer is NULL, the default values for the structure are used.

pTOCCreateOptions

A pointer to the KVXMLTOCOptions data structure. It specifies whether a heading is included in the table of contents. See KVXMLTOCOptions.

If this pointer is NULL, the default values for the structure are used.

pPID

The address of a DWORD into which the Servant process ID is returned.

pError

A pointer to an error code defined in KVErrorCode in kverrorcodes.h.

dwOptions

Reserved for future use.

pReserved1

Reserved for future use.

pReserved2

Reserved for future use.

Returns

Discussion

Example

The following sample code is from the cnv2xmloop sample program:

/* declare OOP startsession function pointer */
BOOL (pascal *fpKVXMLStartOOPSession)( void     *,
                KVInputStream      *,
                char               *,
                KVXMLTemplate      *,
                KVXMLOptions       *,
                KVXMLTOCOptions    *,
                DWORD              *,
                KVErrorCode        *,
                DWORD               ,
                void               *,
                void               * ); 
/* assign OOP startsession function pointer */
fpKVXMLStartOOPSession = (BOOL (pascal *)( void      *,
                KVInputStream       *,
                char                *,
                KVXMLTemplate       *,
                KVXMLOptions        *,
                KVXMLTOCOptions     *,
                DWORD               *,
                KVErrorCode         *,
                DWORD                ,
                void                *,
                void                * ))mpGetProcAddress(hKVXML, "KVXMLStartOOPSession");
if(!fpKVXMLStartOOPSession)
{
   printf("Error assigning KVXMLStartOOPSession() pointer\n");
   (*KVXMLInt.fpFileToInputStreamFree)(pKVXML, &Input);
   (*KVXMLInt.fpFileToOutputStreamFree)(pKVXML, &Output);
   mpFreeLibrary(hKVXML);
   return 7;
}
/********START OOP SESSION *****************/
if(!(*fpKVXMLStartOOPSession)(pKVXML,
        &Input,
        NULL,
        &XMLTemplates,        /* Markup and related variables */
        &XMLOptions,          /* Options */
        NULL,                 /* TOC options */
        &oopServantPID,
        &error,
        0,
        NULL,
        NULL))
{
   printf("Error calling fpKVXMLStartOOPSession \n");
   (*KVXMLInt.fpFileToInputStreamFree)(pKVXML, &Input);
   (*KVXMLInt.fpFileToOutputStreamFree)(pKVXML, &Output);
   (*KVXMLInt.fpShutDown)(pKVXML);
   mpFreeLibrary(hKVXML);
   return 9;
}