New User? Sign Up  |  Sign In  |  Help
Barcode support and
tutorials from IDAutomation
and the community.
Click for the BBB Business Review of this Computers Hardware, Software & Services in Tampa FL
Resolved Questions Bookmark and Share

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.

Operating System: Windows x86 x64

Application: .Net WinForms

03-24-15     2013 day(s) ago    

  Report Abuse

 

Ben

Best Answer

Thank you Paul

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.


Posted 2012 day(s) ago

(0)
(0)
  Report Abuse
 
Find Interesting
 
Email to Others
 
Bookmark
 
Subscribe to Answer Alert
No comments yet.     Be the first to comment.

Email this question link to friends
You must enter an email address, if name is entered or vice-versa for each friend.
Friend #1 -
Friend #2 -
Friend #3 -
Friend #4 -
Friend #5 -
  Your comment on this question
  |         |  
bold  italic  underline  strike       big  small       superscript  subscript 
  Allows to add a link. Added links would only be converted to actual clickable link, when the domain of the link is white-listed by administrator.
Caption :
Link URL :
(Must starts with "http://")
Add  |   Cancel
  Allow to insert an image. Must be among the following file types - *.jpg, *.gif, *.png & *.bmp.
Image Url :   Upload New
(Image url must always starts with " http:// ")
Width : pixels
(Must not be greater than 450px. Enter 0px for no resize)
Add  |   Cancel
  Allow to insert YouTube video. Insert the video embed code.
Embed Code :
Add  |   Cancel
Up to 5000 Characters are allowed. Current Count: 0
  Your comment on this answer
  |         |  
bold  italic  underline  strike       big  small       superscript  subscript 
  Allow you to add a link. Added links would only be converted to actual clickable link, when the domain of the link is white-listed by administrator.
Caption :
Link URL :
(Must start with "http://" or "https://")
Add  |   Cancel
  Allow to insert an image. Must be among the following file types - *.jpg, *.gif, *.png & *.bmp.
Image Url :   Upload New
(Image url must always start with "http://" or "https://")
Width : pixels
(Must not be greater than 450px. Enter 0px for no resize)
Add  |   Cancel
  Allow to insert YouTube video. Insert the video embed code.
Embed Code :
Add  |   Cancel
Up to 5000 characters are allowed. Current Count: 0

You may answer and comment on any thread according to the Terms and Conditions.

 © Copyright 2019 IDAutomation.com, Inc., All Rights Reserved. Legal Notices.

 Barcode Fonts | Components | Scanners | Support | Contact Us
Training Videos on YouTube Join us on Google Plus Join us on LinkedIn Follow us on Twitter Like us on Facebook