I can't see the value for statusBar in the debugger, since the ui object can't be expanded for some reason...
Then that tells me that the memory occupied by "ui" is already corrupted before you ever get to the part where you try to set the status message. The error you are seeing has nothing to do with the status bar, that's just a red herring. The real problem is a memory corruption error.

- Make sure that all of your pointers are initialized before you try to use them
- Make sure all other variables are initialized, either to zero or some non-valid value.
- Remember that the debugger sets uninitialized variables to some non-valid value so they will be easily recognized when debugging (like 0xdcdcdcdc or whatever) and resets the values of pointers to another bogus value when they have been deleted (but are still in scope). If you see things like that, there's your memory problem.
- Also remember that this doesn't happen in Release mode - variables and pointers do not get initialized, so they hold whatever value the memory location they are in had when they come into scope. Behavior in Debug and Release modes can therefore be different.