which gets me all key names in the specified section (as per Win doc, if keyName is NULL).
This works fine, but the problem I'm having is I don't know how to best determine the size of the passed char array.
The application could (potentially) have zero entries there or say 50.
Is there something I can pass which can grow dynamically instead of char to avoid buffer overflow, or alternatively is there a way to get the number of entries beforehand, or any other approach?
Yes, I know it's outdated.
But as the application is using .ini files to store information (also to make it portable I guess), that's not on my part to decide (I only do an extension for it, not the application itself).
If you pass the correct value for nSize then you won't overflow your string, however you may not retrieve all of the strings if there is not enough room.