I'm hoping someone can explain some behavior my program exhibits that
confuses me a lot....
System is Windows XP SP2 with current hotfixes/updates.
I have a program (developed in-house) that hosts an ActiveX control
(developed in-house) that deals with "static" images - JPG, BMP,
non-animated GIF, etc. As part of a performance improvement, there was a
cache added that preloads the images into a list. Speeds up time to get
things on the screen. And these can be up to full-screen in size.
As a bit of a stress test, I loaded about 500 images. On a low-memory
machine (physical ram 128 MB - I know, it's amazing that XP runs really, let
alone runs extra stuff) this worked for a while, then I got message boxes
popping up that had my program's name in the title bar, and said "Out of
system resources" and had an OK button.
That's not really the puzzling part - I was really trying to see what was
going to happen, and sadly, that wasn't what I wanted to see. I thought that
there was a lot of exception handling in place to prevent these sorts of
messages appearing on the screen, and that messages would end up in the
application event log instead.
So, puzzling point #1: where do these messages come from that wouldn't get
trapped by my existing exception handling code? (I know, I don't have any
code shown. I'd have to cleanse it first to put it in a public forum).
But, even more puzzling point #2: when I was looking at Task Manager to see
resources, etc., I was amazed to see that these message pop-ups were listed
as applications, and not processes, or even as something within my original
process. The applications were listed with my programs name, and that's what
was in the title bar. What's up with that? What program is really running?
Since I really don't want these messages appearing on the screen, I'm
looking at
a) figuring out how to trap that problem in my program
b) restructuring my program to not cache as many images at one time
c) having some task/thread running that checks for extra windows with the
program title that I didn't start and closes it forcefully if one is found
d) putting some sort of windows hook in that blocks the opening of the
window if I didn't create it
But I'd really like to know where this message is getting raised and how it
avoids my error checking and exception handling.
Thanks.