You're mid-print job or running some graphics-heavy app, and suddenly it throws 0x00000591 – ERROR_DC_NOT_FOUND. This isn't a random occurrence. It shows up when a program tries to use a device context (DC) handle that Windows has already invalidated or never returned. I've seen this with old print drivers, buggy screen capture tools, and custom drawing apps that forget to call DeleteDC(). The culprit here is almost always a handle leak or a driver that didn't clean up after itself.
The DC is just a structure Windows uses to talk to a display or printer. When you ask for a DC, you get a handle. If that handle goes stale – say the window it belonged to got destroyed, or the driver crashed – any call using it returns this error. Most users hit this while printing, but I've also seen it in remote desktop sessions and when a graphics card driver resets mid-render. Root cause? Either your app is leaking GDI objects, or the print spooler is holding onto a dead DC.
Fix 1: Restart the Print Spooler
If this error fires during printing, the spooler is your first suspect. It often gets stuck with an invalid DC after a driver hiccup. Do this:
- Open Services (Win+R, type
services.msc, Enter). - Find Print Spooler.
- Right-click, select Restart. If it's already stopped, start it.
That clears any stale handles the spooler was holding. Works about 50% of the time. If the error persists, move on.
Fix 2: Update or Reinstall Your Printer Driver
I can't stress this enough – bad printer drivers are the number one cause of DC errors. Manufacturers have shipped some real junk over the years. Don't bother with Windows Update for this; go straight to the vendor's site and grab the latest version for your exact model. For example, if you're on a Dell 5130cdn, don't use the generic driver Windows installed. Download the Dell-specific one.
If you already have the latest, uninstall and reinstall:
- Go to Devices and Printers.
- Right-click your printer, choose Remove device.
- Disconnect the printer, reboot, reconnect, and let Windows find it again. Or install the driver manually from the downloaded file.
Fix 3: Check for GDI Handle Leaks in Your App
If this isn't about printing – you're running a custom app or a game – the app itself might be leaking handles. Every GetDC() call needs a matching ReleaseDC() or DeleteDC(). Miss one and you're slowly eating GDI handles. Windows has a limit of 10,000 per process. Hit that and you'll see this error shortly before the app crashes.
To check if you're near the limit:
- Open Task Manager (Ctrl+Shift+Esc).
- Go to the Details tab.
- Add the GDI objects column (right-click header, select columns).
- Watch your problematic app. If it's climbing steadily, that's your leak.
If it's your own code, search for GetDC and make sure every call has a matching ReleaseDC. For third-party apps, you can't fix that – but you can avoid the trigger or update the app.
Fix 4: Clean Up Your Display Driver
This one's for gamers or folks running CAD software. NVIDIA or AMD drivers can sometimes leave DC handles dangling after a driver reset. A clean reinstall often clears it:
- Download Display Driver Uninstaller (DDU).
- Run it in Safe Mode (shift + restart, then troubleshoot).
- Select your GPU vendor and clean and restart.
- Install the latest driver from the vendor's site.
What If It Still Fails?
So you've done all that and the error still haunts you. Time to dig deeper. Run sfc /scannow from an admin command prompt to check for corrupted system files. If that finds nothing, check the application's event log entries around the time of the error – they might point to a specific module failing.
Also, check if the issue only happens in a specific user session. I've fixed this once just by logging off and back on – the session had accumulated garbage. If it's happening across all users, suspect a service or startup program calling GDI functions incorrectly.
Final resort: a clean boot. Disable all non-Microsoft services and see if the error disappears. If it does, re-enable them one by one until you find the offender. I've seen antivirus tools and cloud sync apps cause this more than once.
Remember, ERROR_DC_NOT_FOUND is almost always a symptom of bad housekeeping – a leaked handle or a driver that forgot its manners. Fix the leak, and the error goes away.