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

Creates an item-list from the currently opened User dictionary together with the IG_REC_UD_item_next_get function.

Declaration:

 
Copy Code
AT_ERRCOUNT ACCUAPI IG_REC_UD_item_first_get(
   LPCSTR pSection,
   LPWSTR pUDitem,
   AT_INT nBufferSize,
   enumIGRecUDItemAttribute* pitemattrib
);

Arguments:

Name Type Description
pSection LPCSTR Name of the section of the User dictionary whose items are to be listed.
pUDitem LPWSTR Pointer to a buffer to get the first UNICODE item of the item-list.
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_INT iSize = 1024; LPWSTR lpszFirst = (LPWSTR) malloc(iSize); enumIGRecUDItemAttribute eFormat = IG_REC_UD_ITEM_ATTR_LITERAL_STRING;

 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);

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

Remarks:

This function returns the first item (the UDitem and its attribute) from the pSection section of the User dictionary. The application has to allocate a buffer with sufficient size to accommodate the current UDitem.

Maximal length of the dictionary item is AM_MAX_UD_ITEM_LEN.