9 mtecsdk_getattribute, Mtecsdk_getattribute, 2 - functions – MagTek EC2000 99875713 User Manual

Page 18

Advertising
background image

2 - Functions

ExpressCard 2000| Instant Issuance Card Personalization System | Programmer’s Reference (Windows SDK)

Page 18 of 21

{

// do further process

}

}

2.9 MTECSDK_GetAttribute

This function reads the buffer specified by pcDocInfo to retrieve an attribute from the XML tag specified
by pcSection and pcKey (for example, it can read the id attribute from the tag <mytag id=5>.

ULONG MTECSDK_GetAttribute (

char *pcDocInfo,

char *pcSection,

char *pcKey,

char *pcValue,

DWORD *pdwLength

);


Parameters:
pcDocInfo - Buffer pointer containing all the key/value pairs.
pcSection - Pointer to null-terminated string containing the section name.
pcKey - Pointer to null-terminated string containing the key name.
pcValue - Pointer to the buffer that receives the retrieved string.
pdwLength - Specifies the size of the pcAttribute buffer.

Return Values:
EC_ST_OK
EC_ST_NOT_ENOUGH_MEMORY
EC_ST_ERR_LOAD_XML
EC_ST_ERR_GET_DOM_POINTER
EC_ST_BAD_DATA
EC_ST_BAD_SECTION_NAME
EC_ST_BAD_KEY_NAME
EC_ST_BAD_VALUE_BUFFER
EC_ST_BAD_BUFFER_LENGTH
EC_ST_KEY_NOT_FOUND

Remarks:
MTECSDK_GetAttribute finds the key in the pcDocInfo buffer then returns its value in pcValue. If the
function succeeds it returns EC_ST_OK.

If pdwLength is less than the size of the returned value, the function returns
EC_ST_NOT_ENOUGH_MEMORY and returns the required size for the pcValue buffer is in the
pdwLength.

If the key/value pair can not be found, pcValue is null and the function returns
EC_ST_KEY_NOT_FOUND.

Example:
char Settings [4096];

Advertising