I am experiencing a rare problem. I wrote a program in C that creates several windows and I use them to load and display images. After using the program for a while loading and displaying images then all of a sudden all the windows on the desktop disappear including the task bar on the bottom. Once this happens I can move the mouse and as I move the mouse over the desktop then pieces of the windows start to reappear again. If you can help me with ideas about what to check on my code to eliminate this problem would be much appreciated

Recommended Answers

All 6 Replies

Look for memory leaks. You may be running out of memory.

Thank you WaltP

well, was that it, did you find a leak?

Not found it yet.

have you looked? open the performance monitor and watch the memory usage while you run the program. does it increase continuously?

do you have calls to malloc, calloc, or realloc?

if so, do you "free" the memory allocated?

... load and display images. After using the program for a while loading and displaying images then all of a sudden all the windows on the desktop disappear including the task bar on the bottom...

This sounds very much like you are leaking GDI objects. That is, you are not disposing of the Windows' GDI objects you create/allocate. One handy utility to check this would be GDIView, which enables you to pinpoint the types of the objects you might be leaking.

Of course, also pay attention to malloc()/free() as already noted.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.