You're right... I see that now. Apologies. It was early on the west coast
and my eyes were still fuzzy.
"Tom Serface" <tom.nospam@camaswood.com> ha scritto nel messaggio
news:80822A9A-E612-49D2-94D2-98C8CAC28A98@microsoft.com...
You could try creating the dialog on the stack rather than creating it
with new. I don't see anywhere here where you are deleting the object
before looping either
The OP has a delete in the if() statement, in the failure branch, before
the next iteration.
When he exits the while loop because of a successfully OK button pressing,
then the dialog is not deleted (but maybe he wants to reuse it in other
parts of the code).
The code I posted has a delete in the loop, has _T() decoration (it
compiles and runs well in both ANSI and Unicode builds), and I used
std::vector to allocate the buffer for file names, not String.GetBuffer.
There must be something wrong in the OP's code, I don't know what
*exactly* is (some leak out of the loop? Some problem due to
String.GetBuffer/ReleaseBuffer in loop? ...); however, with the OP's code
and VS2003, I experienced the same OP's error, too; but adjusting the code
like described, it seems fine.
Giovanni