6 mtecsdk_setattribute, Mtecsdk_setattribute, 2 - functions – MagTek EC2000 99875713 User Manual

Page 14

Advertising
background image

2 - Functions

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

Page 14 of 21

Remarks:
If the pcOptions buffer is not large enough to add the new key/value pair, the function returns
EC_ST_NOT_ENOUGH_MEMORY, and the required size of the buffer is returned in pdwLength.

If pdwLength is less than the size of the results pcOptions after new key/value pair is added, the functions
returns EC_ST_NOT_ENOUGH_MEMORY.

Example:
char Settings [4096];
DWORD SettingsBufferSize;

// Initialize Settings

// Initialize the Settings variable first
SettingsBufferSize =4096;

// Set a value of “4” to the key “Number” in section “ImageOptions”and
// store this new key/value pair in the buffer” Settings”
dwStatus=MTECSDK_SetValue(Settings, "ImageOptions","Number","4",
&SettingsBufferSize);

2.6 MTECSDK_SetAttribute

This function modifies the pcOptions buffer to set an attribute inside the XML tag specified by pcSection
and pcKey (for example, it can add an id tag of the form <mytag id=5>.

ULONG MTECSDK_SetAttribute (

char *pcOptions,

char *pcSection,

char *pcKey,

char *pcValue,

DWORD *pdwLength

);


Parameters:
pcOptions - Pointer to null-terminated string buffer containing all key/value pairs.
pcSection - Pointer to null-terminated string containing the section name.
pcKey - Pointer to null-terminated string containing the key name. To remove the whole pcSection from
the pcOptions buffer, set pcKey to NULL.
pcValue - Pointer to null-terminated string containing the attribute value to set.
pdwLength - Pointer to a double word that contains the size of the pcOptions buffer. The minimum size
of the buffer should be equal to MTEC_OPTIONS_BUFFER_SIZE.

Return Values:
EC_ST_OK
EC_ST_NOT_ENOUGH_MEMORY
EC_ST_BAD_DATA
EC_ST_BAD_SECTION_NAME
EC_ST_BAD_BUFFER_LENGTH

Remarks:

Advertising