ImageGear for C and C++ on Windows v19.6 - Updated
IG_REC_UD_item_next_get
API Reference Guide > Recognition Component API Reference > Recognition Component Functions Reference > User Dictionary Functions > IG_REC_UD_item_next_get

Creates an item-list from the currently opened User dictionary.

Declaration:

 
Copy Code
AT_ERRCOUNT ACCUAPI IG_REC_UD_item_next_get(
   LPWSTR pUDitem,
   AT_INT nBufferSize,
   enumIGRecUDItemAttribute* pitemattrib
);

Arguments:

Name Type Description
pUDitem LPWSTR Pointer to a buffer to get the next UNICODE item (word) in the item-list. If the returned string is empty, the inquired section of the User dictionary does not contain further elements.
nBufferSize AT_INT Specifies the size of the pUDitem buffer in bytes. It must be large enough to hold all the characters and the terminating zero.
pitemattrib enumIGRecUDItemAttribute* Pointer to a variable to hold the item's attribute.

Return Value:

Returns the number of ImageGear errors that occurred during this function call.

Supported Raster Image Formats:

This function does not process image pixels.

Example:

 
Copy Code
 AT_ERRCOUNT ErrCount = 0; AT_ERRCODE ErrCode = IGE_SUCCESS; AT_INT iSize = 1024; LPWSTR lpszFirst = NULL; enumIGRecUDItemAttribute eFormat = IG_REC_UD_ITEM_ATTR_LITERAL_STRING;

 lpszFirst = (LPWSTR) malloc(iSize);

 ErrCount += IG_REC_UD_set("NEW_USER.DICT", "Section_A"); ErrCount += IG_REC_UD_edit_open();

 ErrCount += IG_REC_UD_item_first_get("Section_A", lpszFirst, iSize, &eFormat); while(ErrCode == IGE_SUCCESS) {  ErrCount += IG_REC_UD_item_next_get(lpszFirst, iSize, &eFormat);  IG_warning_get(0, NULL, 0, NULL, &ErrCode, NULL, NULL, NULL, 0); }

 ErrCount += IG_REC_UD_edit_close(); free(lpszFirst);

Remarks:

Should be used together with the IG_REC_UD_item_first_get function. This function returns in its pUDitem parameter the next item of the item-list from the section (specified by a previous IG_REC_UD_item_first_get function call).

Repeated calls to this function get a sequence of the UDitems (User dictionary items) and return 0 each time. As soon as the function finds no further item to get, the warning IGW_LAST_ITEM_REACHED is added to the warning stack. Function IG_warning_check() returns non-zero value in this case, signaling that the list is complete. Maximal length of the dictionary item is AM_MAX_UD_ITEM_LEN.