How many documents are open? Is your applicaton properly closing and releasing the documents after each iteration? Windows has a limit on how many GDI objects it can have allocated. The SolidWorks error message indicates that you are exceeding that limit.
The only applications I have open while the simulation is running are Matlab and Solidworks. One dimension changes by a particular step size, gets rebuilt, and the simulation is run. As far as I can tell, the application is closing properly. I am running Solidworks Student Edition 2012 with service pack 2.