|
-
January 18th, 2013, 11:41 AM
#19
Re: Invalid access to memory location using GlobalFree
Yes well, I posted the above code snippets for you all to have a laugh - at the moment I could do with one myself. The guys that wrote it have all long gone and until I started to look in detail at the program no one had a clue it was so badly coded (which says something about management, project control etc etc - further heads are rolling over this). We've now looking at other programs these guys had messed with to get an idea of how big a problem we really have.
I won't try to disect the code snippets much. I'm writing a completely new program to replace this mess from the ground up and this sort of mad programming won't feature. As far as I can tell, this code had two purposes. One was to check that memory wasn't being corrupted - which comes back to my original posting question re error with GlobalFree which started off this whole episode - and second was to make sure that the message loop in the main program wasn't waiting around for processing to complete whilst dealing with a message and hence not making the program responsive to user input/mouse etc. If a message took too long to process then the hearbeat would fail and an error message displayed. Practically every message in the main WndProc function that is processed within the program starts a new thread!!!! As I said before, I've never in all my years programming seen anything like it - and I hope I never will.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|