KVHTMLSetHighlight()

This function is called directly and enables you to specify search terms that are found and highlighted in the HTML output. See Search and Highlight Terms. The htmlini sample program demonstrates this function. See htmlini.

Syntax

int pascal_export KVHTMLSetHighlight(
    void             *pContext,
    KVHTMLHighlight  *pHLConfig,
    void             *pReserved1,
    void             *pReserved2 );

Arguments

pContext

A pointer to a KeyView Export session that you initialized by calling fpInit().

pHLConfig

A pointer to the KVHTMLHighlight data structure. This structure defines the terms to be found and the highlight format applied. See KVHTMLHighlight.

pReserved1

Reserved for future use.

pReserved2

Reserved for future use.

Returns

  • If the call is successful, the return value is KVERR_Success.

  • If the call is unsuccessful, the return value is an error code.

Discussion

  • This function must be called after the call to fpInit() and before the call to fpConvertStream() or KVHTMLConvertFile().

  • When converting out-of-process, this function must be called before the call to KVHTMLStartOOPSession(). See Convert Files Out-of-Process.

Example

KVHTMLHighlight     HTMLHighlight;
int (pascal *fpHTMLSetHighlight)(void *, KVHTMLHighlight *, void *, void *);
//get function pointer and call the function
fpHTMLSetHighlight = (int (pascal *)
   (void *, KVHTMLHighlight *, void *, void*))myGetProcAddress(hKVHTML, "KVHTMLSetHighlight");
   if(!fpHTMLSetHighlight)
   {
      printf("Error accessing HTMLSetHighlight().\n");
   }
   else
   {
      if(KVERR_Success != (*fpHTMLSetHighlight)(pKVHTML, &HTMLHighlight, NULL, NULL))
      {
         printf("Error setting HTML highlight.\n");
      }
   }
}