I've created a program that will parse the log file generated by an MFP (Multi-Functional Printer). The program works fine when I parse a log file with less than 2000 lines, but when it reached more than 2000 lines (I've tried the log files with 8000 and 22000 lines), the program hangs and not responding, but it still do the task before it hangs.

Can someone have any idea why my program can't manipulate log files with more than 2000 lines?

Tricky without seeing the code. Is there something different about the line format after 2000 lines? Try editing out 1500 lines and see if it falls over at the same place.
Are you allocating memory dynamically and not releasing it?
Have you allocated a static buffer which you are overflowing?

I'm just using CString variables wherein it holds the data.
How can I clear the value of a variable? I'm just using = ""; (ex. translated = ""; ). Is it enough to clear the memory?

I'm just using CString variables wherein it holds the data.
How can I clear the value of a variable? I'm just using = ""; (ex. translated = ""; ). Is it enough to clear the memory?

Yes, that would clear it. There is a .Empty() method if you prefer that.

I'm just using CString variables wherein it holds the data.
How can I clear the value of a variable? I'm just using = ""; (ex. translated = ""; ). Is it enough to clear the memory?

It's only clearing the value of a variable, it's not releasing the assigned memory ...

It's only clearing the value of a variable, it's not releasing the assigned memory ...

I'm assuming he's referring to an MFC CString variable, in which case ="" would indeed release the memory.
He could be talking about something else though...

This article has been dead for over six months. Start a new discussion instead.