Bleh!!!! more potential problems come out.
AnsiStrings are somewhat different from a standard C++ string. Not least of which is that an AnsiString is actually a hybrid type from Delphi, with attributes such as indexing starting at 1 (mismatched indexing is a common source of errors with arrays). AnsiString's use a COW (copy on write) technique for lazy copy, which is not necessarily thread safe, so considerable care is needed to use them correctly in multi-threaded code.
However, while AnsiStrings can be misused, I would not necessarily assume your real problem is with AnsiStrings.
If what you say here is true then, quite frankly, if you've never had problems in code you wrote before, that was good luck rather than good planning. Or, more likely, the problems existed in your original code, but you were simply oblivious.
The main point of advice in this thread is to program defensively to avoid errors, rather than trying to find the cause of errors after the fact.
Essentially, you are doing exactly the opposite: mashing together sections of code that (you think) worked separately, assuming they will work together, and then struggling to find the causes of errors that occur because you have mashed them together.



LinkBack URL
About LinkBacks



