Posted: 30 Nov 2017, 15:42
Can someone explain how to use the new sdkAddSettingsLineString in the SDK ?
There are 3 new functions in the new SDK:
void sdkAddSettingsLineString(AnsiCharPtr tab, AnsiCharPtr pVal, AnsiCharPtr caption, LongBool Translate = FALSE)
void sdkSetSettingValue(AnsiCharPtr settingName, UsineEventPtr settingEvent)
UsineEventPtr sdkGetSettingValue(AnsiCharPtr settingName)
sdkAddSettingsLineString
- who allocates the memory that the string is stored in, for example, should pVal be just a pointer for Usine to set up, or should it point to a buffer ? If a buffer, where is the size of the buffer specified ?
If I allocate a buffer, then the string can be modified from the Usine settings panel, but I cannot access it from within the User module, either to read the modified value in onSettingsHasChanged(), or to set the value from within the User module.
Should sdkGetSettingValue and sdkSetSettingValue be used to do this ? I have tried various things but nothing works, including this:
UsineEventPtr ev = sdkGetSettingValue(SettingsLineStringCaption);
AnsiCharPtr pointer_to_settings_string = sdkGetEvtPChar(ev);
Can we please have an example User module that does this, since it is not obvious ?
Thanks,
Simon.
There are 3 new functions in the new SDK:
void sdkAddSettingsLineString(AnsiCharPtr tab, AnsiCharPtr pVal, AnsiCharPtr caption, LongBool Translate = FALSE)
void sdkSetSettingValue(AnsiCharPtr settingName, UsineEventPtr settingEvent)
UsineEventPtr sdkGetSettingValue(AnsiCharPtr settingName)
sdkAddSettingsLineString
- who allocates the memory that the string is stored in, for example, should pVal be just a pointer for Usine to set up, or should it point to a buffer ? If a buffer, where is the size of the buffer specified ?
If I allocate a buffer, then the string can be modified from the Usine settings panel, but I cannot access it from within the User module, either to read the modified value in onSettingsHasChanged(), or to set the value from within the User module.
Should sdkGetSettingValue and sdkSetSettingValue be used to do this ? I have tried various things but nothing works, including this:
UsineEventPtr ev = sdkGetSettingValue(SettingsLineStringCaption);
AnsiCharPtr pointer_to_settings_string = sdkGetEvtPChar(ev);
Can we please have an example User module that does this, since it is not obvious ?
Thanks,
Simon.