Re: CString concatenation
The chances that a CString += operation causing a crash are pretty close to zero. Unless your string are millions of characters long, I would suspect that if you're having problems the cause is somewhere else.
Re: CString concatenation
Yes it used to work fine. Now, when I'm debugging the app, sometimes I get an error at that location.
it is something like: (the aStr has the sufficient length so the delete is not the problem.
Code:
aStr.Delete(0,8);
formatted += " Bank: ";
formatted += aStr.Left(2);
formatted += '\n';
//bank
aStr.Delete(0,2);
formatted += " Address: ";
formatted += aStr.Left(4);
formatted += '\n';
//length
aStr.Delete(0,4);
formatted += " Length: ";
formatted += aStr.Left(4);
formatted += '\n';
Re: CString concatenation
Looking at that code, the most like problem is that it's actually Left blowing up if aStr is too short.
Have you tried the debugger?
Re: CString concatenation
Thanks! I'll take a look at that.