Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

System Resource problem on screensaver

Status
Not open for further replies.

schwankieog

Programmer
Jul 25, 2001
43
US
i wrote a screensaver using mfc. all that it does is ouput lines at various locations on the screen in mathmatical patterns. i do not allocate any dynamic memory during the program, and reset the only counter at 15. I do declare two CPen pointer variables, but they are at function scope. I also seed the random number generator every 15 times through the loop by srand(time(0)+rand()%20); just to randommly set the color of the lines. Neither of these should effect the system resources nor should the rest of the program which is just moving to locations and drawing lines. The screensaver compiles and runs fine for approx. 15 minutes. at 15 minutes the saver freezes and i receive an error telling me there are not enough system resources available. the system does respond then to my moving the mouse or a keystroke by shutting down the screen saver and returning to windows. I am using XP so i check the processes running and it is not, and after i shut down the screensaver the system returns to normal. Thanks for reading m,y description of the problem and if any one has any idea why this is happening please let me know.
 
Take a look at MSDN knowledgebase articles:
Q194655
Q171145

And search on "Finding Leaks and Bottlenecks with a Windows NT PerfMon COM Object"

Chip H.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top