Lena wrote:When I write a new section, I want to get a unique new value. The section name must be equal image=.

If the filename is always derived from the section name, then what's the point of storing the filename explicitly at all?

Lena wrote:I chose this way:...It seems everything is right and works. Is this the optimal solution?

Sure, if your section names are sequential. But what if there are gaps between them? For instance, if sections get deleted over time. You could use one of those missing numbers instead of calculating the next largest value. To do that, sort the vector and then iterate through it. If two adjacent elements do not have consecutive values, pick a random number between those two values (or, just the next available number in the sequence). If you end up at the end of the vector, then all section names were consecutive, so use the next highest number instead. For example (untested):

Lena wrote:I try this:...E2285 Could not find a match for 'TRegEx::TRegEx(const wchar_t *)'

If you read the documentation, you will see that TRegEx does not have a constructor that takes a single wchar_t* as input. It's constructor takes a System::String and a TRegExOptions as input. The TRegExOptions is supposed to have a default value, but like most things in the RTL, TRegEx is written in Delphi, and depending on which version of C++Builder are you using, the constructor might not have a default value for the TRegExOptions parameter in C++ (in fact, the documentation even shows that)! Double-check your .hpp file to verify.