Since there is no variable called "dlg" in that code snippet, we can't guess at what the problem might be.

However, this error usually occurs because you have an array declared in the same stack frame as the variable, and you've overrun its bounds.