L_ISISGetTagASCIIChoice

#include "l_bitmap.h"
#include "ltisi.h"

L_INT EXT_FUNCTION L_ISISGetTagASCIIChoice(uTag, nIndex, pszValue, puSize)

L_UINT uTag;

/* ASCII tag */

L_INT32 nIndex;

/* index value */

L_CHAR L_FAR *pszValue;

/* character string */

L_UINT32 L_FAR *puSize;

/* size of the string */

Gets the number of possible values (or choices), or gets the value at the specified index, for the specified ISIS Scanner Driver ASCII Tag. This function is available in the Document/Medical Toolkits.

Parameter

Description

uTag

Value indicating the tag for which to get the specified value, or the number of possible values. For a list of possible tags, refer to ISIS ASCII tags.

nIndex

Index into an array of possible values (or choices) for the specified ASCII tag. This value must be between 0 and the maximum number of values/choices - 1. Pass ISIS_DEFAULT to update puSize with the maximum number of available values/choices for the specified tag.

pszValue

Character string to be updated with the value at the specified index.

puSize

Pointer to a variable that contains the size of the string. If pszValue is NULL, then puSize will be updated with the required size of the string for the specified tag value.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

ISIS tags can have multiple values, also called choices. This function can be used to get the maximum number of available values/choices, or to get individual values.

To get the maximum number of available values/choices, pass ISIS_DEFAULT for nIndex. The puSize parameter will be updated with the number of available values/choices.

The user is responsible for allocating storage for pszValue and for freeing that memory when pszValue is no longer needed.

To determine the size of the value string, call this function with pszValue set to NULL and nIndex set to the desired value. The puSize parameter will be updated with the necessary size. Then, call this function again, with the correct size in the puSize parameter and pszValue will be updated with the value string.

If a valid pointer is passed for the pszValue parameter, then puSize must contain the correct size for the string pointed to by pszValue.

Required DLLs and Libraries

LTISI

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions:

L_ISISGetTagASCII, L_ISISSetTagASCII, L_ISISGetTagLong, L_ISISSetTagLong, L_ISISGetTagLongChoice, L_ISISGetTagShort, L_ISISSetTagShort, L_ISISGetTagShortChoice

Topics:

Raster Image Functions: Scanning Images using ISIS

 

Using ISIS to Scan Images

Example

   L_UINT32 uSize;
   L_UINT32 uCount;
   L_UINT32 x;
   L_CHAR L_FAR* pszValue=NULL;
   L_CHAR szBuf[400];
   L_INT nRet;

   //First, get the number of choices
   nRet = L_ISISGetTagASCIIChoice(TAG_PAGESIZE, ISIS_DEFAULT, NULL, &uCount);
   if(nRet == SUCCESS)
   {
      //get and display each choice
      wsprintf(szBuf, "There are %u choices\n", uCount);
      MessageBox(NULL, szBuf, "Count", MB_OK);
      for(x=0; x<uCount; x++)
      {
         //get size of the choice string
         nRet = L_ISISGetTagASCIIChoice(TAG_PAGESIZE, x, NULL, &uSize);
         if(nRet == SUCCESS && uSize>0)
         {
            //allocate memory for the string
            pszValue = (L_CHAR L_FAR*)GlobalAllocPtr(GMEM_MOVEABLE|GMEM_ZEROINIT, uSize*sizeof(L_CHAR));
            //get the value
            nRet = L_ISISGetTagASCIIChoice(TAG_PAGESIZE, x, pszValue, &uSize);
            wsprintf(szBuf, "Choice: %u has Value: %s\n", x, pszValue);
            MessageBox(NULL, szBuf, "Value", MB_OK);
            //free the string
            GlobalFreePtr(pszValue);
         }
      }
   }