First it looks like you make a definition of the property with a list of enum labels. Looks fine.
But the code there is strange.
Since you use std::string there, the ptr you get from c_str() function is temporary. putting it in charArray won’t be good, since on access later it will point to released string.
I’m trying to create a drop-down menu property of a class containing file names from a specified folder.
The properties definition requires a const char* and the file names are returned as a stringstream hence the example of code before containing the data type conversions.
As you pointed out my current method won’t work, is there a better way of doing this conversion to work with what i’m trying to accomplish?
You say the plugin defines a drop-down menu in the inspector properties pane of the IDE. That is only possible with a static array. Usually this is being done for a REALcontrol. Any other way other than a static array will crash Xojo. Our plugins use these static arrays in many cases to ease the setup of a plugin for runtime purposes.