Info - A generic error occurred in GDI+
I have noticed at least two questions here about this error using a barcode control with Windows Forms - neither answer I've seen provides much info.
A few years ago, I encountered this same problem. In my case, I was generating a print job via GDI+ alongside PLC communications, whereby a PLC essentially commanded a Winforms app to print. The system worked on a 32 bit XP Dev Box, but had this error at the install site after running for a while. What I found was that 64 bit Windows Server had been loaded instead of 32 bit, not what I had recommended.
After 700 to 900 print jobs had been generated, this error would be thrown. I proceeded to test to 10k print jobs (successfully, if only to a bogus printer) on my dev box before I was told this was a 64 bit box.
The OPC code used to talk to the PLCs used a 32 bit wrapper, and the application was compiled as x86, 32 bit. I ended up building a separate 64 bit app just for printing, compiled as x64, and this caused no issues and was the solution to my problem. If I switched this application to 32 bit compile, it would again fail at 600 to 900 print jobs.
Compile to x64, no problem. Compile to x86, generic error in GDI+.
I could reproduce the problem on any 64 bit machine I tried.
The problem as I see it relates to 32 bit GDI+ calls on an x64 box - a Microsoft problem. Being that a large number of operations is necessary to trigger, Microsoft likely never bothered to test backwards compatibility from x64 to x32 to that extent. At the time, I pointed out to my superiors that MS would likely never fix this issue.
Since then, I have seen this on Win7, so the problem seems to persist.
Windows x86 x64
03-24-15 2660 day(s) ago