here is my problem: I want to expand the FileName that the user gives the program in the SaveFileDialog with an index number. I get the complete Path out of the dialog and search '.' in it.
System::String^ str = saveFileDialog1->FileName;
pin_ptr<const wchar_t> wch = PtrToStringChars(str);
size_t convertedChars = 0;
size_t sizeInBytes = ((str->Length + 1) * 2);
errno_t err = 0;
char *FileName = (char*)malloc(sizeInBytes);
err = wcstombs_s(&convertedChars,
FileName, sizeInBytes,
wch, sizeInBytes);
for (size_t i = 0; i < sizeof((*FileName )); i++)
{
if (FileName [i]=='.')
{
}
}
and at this point I have tried different things to edit the FileName with:
insert(i-1, ("_%i",i));
Nothing I have tried, works how I want it.
I want to save different pictures of a camera and with this index it is easier for the user to find the picture he want.
Thanks in advance!
Knut