API Reference | developer.brewmp.com API Reference | developer.brewmp.com

Developer

API Reference

IVALUEMODEL_SETTEXT()

Brew Release
Brew MP 1.0.2
See Also
- Model Events - IValueModel_GetText() - IValueModel_SetValue() - IValueModel_SetTextPtr()
Description
This function changes the AECHAR text stored in a value model, making a copy of the text which BREW then stores into the value model (thereby providing ownership of the data to the model).
This function is deprecated due to the use of the mod1 incompatbile MALLOC call. Although no replacement is currently provided, a mod1 compatible (IEnv based) method will be provided as IValueModel_SetText in future releases.
Params
pif
[]:
[in] Pointer to the IValueModel interface object.
pwText
[]:
[in] Pointer to the text to be stored into the value model.
nLen
[]:
[in] The length of the text to be stored into the value model. Pass (-1) to automatically compute the length of pwText.
Interface
  • IVALUEMODEL
Prototype
  •    int IVALUEMODEL_SetText(IValueModel *pif, const AECHAR *pwText, int nLen); 
    
Return
  •    AEE_SUCCESS    --  If the text was stored successfully in the value model.
       ENOMEMORY  --  If the value model was unable to allocate storage for the text.
    
Side Effect
  • Changing the text stored in the value model by calling IValueModel_SetText() will cause BREW to send an EVT_MDL_VALUE ModelEvent to any object that has registered as a listener with the model.
    IValueModel_SetText() calls IValueModel_SetValue().
Comments
BREW will use its generic free memory handler to free the memory occupied by the string to be replaced. Callers may not use a custom PFNVALUEFREE callback to free the memory occupied by the text.