[ad_1]
In the VB app I’ve just inherited from a colleague (now gone somewhere else), I have to solve a problem where the app just hangs and doesn’t execute eanything.
I’ve come to the conclusion that the problems lays here:
For Each printer In System.Drawing.Printing.PrinterSettings.InstalledPrinters
which in turn calls
SafeNativeMethods.EnumPrinters(6, null, level, IntPtr.Zero, 0, out var pcbNeeded, out var pcReturned);
For some reason, I’m not getting any answer from Windows about the printers (all network printers).
Please note that this same code works just fine for thousands of times before failing.
The only way I’ve found to reset is to reboot (restarting the app or the spooler isn’t enough to make everything ok)
Could you please give me some hint?
I apologize for being scarce with information, but I truly am in need of an urgent feedback, and I haven’t yet had the time to study the technology nor the code…
THANK YOU
[ad_2]