Setting Up the SPLBUFFER Structure

Before you call SplCheck or SplSuggest, set up the SPLBUFFER structure. A SPLBUFFER structure contains a variety of data for the spelling checker functions. First, it contains the input buffer that holds the text that you are checking. It also contains parameters for containing spelling suggestions returned by the spelling checker, the type of spelling error that occurred, where in the input buffer the spelling checker should look next, and how the spelling checker should proceed.

    To set up the SPLBUFFER structure for a call to SplCheck

  1. Set pwzIn to point to the buffer containing the text that you want to check the spelling of.
  2. Set iwcIn to 0.

    The iwcIn member contains the offset for where SplCheck begins searching for misspelled words. Setting iwcIn to 0 causes SplCheck to begin searching at the beginning of the input buffer.

  3. Set cwcIn to the size of the input buffer relative to pwzIn.
  4. Set dwMode to SPL_NO_STATE_INFO or SPL_STARTS_SENTENCE.
  5. Set dwErr to receive an error code from SplCheck.

    SplCheck places the results of the spelling session in dwErr.

  6. Set iwcErr to receive the index of the location of the spelling error, if such an error exists.
  7. Set cwcErr to receive the length of the word containing the spelling error, if such an error exists.