This function performs the following:
Initializes the out-of-process session.
Specifies the input stream or file.
Passes conversion options from the KVHTMLTemplateEx, KVHTMLOptionsEx, and KVHTMLTOCOptions data structures.
Creates a Servant process.
Establishes a communication channel between the application thread and the Servant.
Sends the data to the Servant.
BOOL pascal KVHTMLStartOOPSession( void *pContext, KVInputStream *pInputStream, char *pFileName, KVHTMLTemplateEx *pTemplatesEx, KVHTMLOptionsEx *pOptionsEx, KVHTMLTOCOptions *pTOCCreateOptions DWORD *pPID, KVErrorCode *pError DWORD dwOptions, void *pReserved1, void *pReserved2 );
|
|
A pointer returned from fpInit() or fpInitWithLicenseData(). |
|
|
A pointer to the developer-assigned instance of If |
|
|
A pointer to the file to be converted. The file must exist on the same file system as the Servant. If |
|
|
A pointer to the If this pointer is |
|
|
A pointer to the If this pointer is |
|
|
A pointer to the If this pointer is |
|
|
Address of a |
|
|
A pointer to an error code defined in |
|
|
Reserved for future use. |
|
|
Reserved for future use. |
|
|
Reserved for future use. |
If the call is successful, the return value is TRUE.
If the call is unsuccessful, the return value is FALSE.
KVHTMLEndOOPSession().KVHTMLStartOOPSession(), and before the call to KVHTMLEndOOPSession(). KVHTMLConvertFile() function can only be called once in a single out-of-process session.KVHTMLTemplateEx, KVHTMLOptionsEx, and KVHTMLTOCOptions data structures are passed by this function, the same pointers in the call to KVHTMLConvertFile() are ignored.The following sample code is from the cnv2htmloop sample program:
/* declare OOP startsession function pointer */
BOOL (pascal *fpKVHTMLStartOOPSession)( void *,
KVInputStream *,
char *,
KVHTMLTemplateEx *,
KVHTMLOptionsEx *,
KVHTMLTOCOptions *,
DWORD *,
KVErrorCode *,
DWORD ,
void *,
void * );
/* assign OOP startsession function pointer */
fpKVHTMLStartOOPSession = (BOOL (pascal *)( void *,
KVInputStream *,
char *,
KVHTMLTemplateEx *,
KVHTMLOptionsEx *,
KVHTMLTOCOptions *,
DWORD *,
KVErrorCode *,
DWORD ,
void *,
void * ))mpGetProcAddress(hKVHTML, "KVHTMLStartOOPSession");
if(!fpKVHTMLStartOOPSession)
{
printf("Error assigning KVHTMLStartOOPSession() pointer\n");
(*KVHTMLInt.fpFileToInputStreamFree)(pKVHTML, &Input);
(*KVHTMLInt.fpFileToOutputStreamFree)(pKVHTML, &Output);
mpFreeLibrary(hKVHTML);
return 7;
}
/********START OOP SESSION *****************/
if(!(*fpKVHTMLStartOOPSession)(pKVHTML,
&Input,
NULL,
&HTMLTemplates, /* Markup and related variables */
&HTMLOptions, /* Options */
NULL, /* TOC options */
&oopServantPID,
&error,
0,
NULL,
NULL))
{
printf("Error calling fpKVHTMLStartOOPSession \n");
(*KVHTMLInt.fpFileToInputStreamFree)(pKVHTML, &Input);
(*KVHTMLInt.fpFileToOutputStreamFree)(pKVHTML, &Output);
(*KVHTMLInt.fpShutDown)(pKVHTML);
mpFreeLibrary(hKVHTML);
return 9;
}
|
|