A generic error occurred in GDI+
A generic error occurred in GDI+
A generic error occurred in GDI+
A generic error occurred in GDI+
A generic error occurred in GDI+
A generic error occurred in GDI+ A generic error occurred in GDI+ A generic error occurred in GDI+ A generic error occurred in GDI+ A generic error occurred in GDI+ A generic error occurred in GDI+ A generic error occurred in GDI+ A generic error occurred in GDI+
A generic error occurred in GDI+ A generic error occurred in GDI+
A generic error occurred in GDI+
Go Back  Xtreme Visual Basic Talk > > > A generic error occurred in GDI+


Reply
 
Thread Tools Display Modes
  #1  
Old 09-24-2016, 07:23 AM
piggybank1974's Avatar
piggybank1974 piggybank1974 is offline
Ultimate Contributor
 
Join Date: Mar 2002
Location: weston-super-mare(UK)
Posts: 1,795
Question A generic error occurred in GDI+


I would like some advice to track down this error,

Unfortunately trying try catch does not work for this error, thanks MS.

My stack trace is this:


at System.Drawing.Image.FromHbitmap(IntPtr hbitmap, IntPtr hpalette)
at System.Drawing.Image.FromHbitmap(IntPtr hbitmap)
at System.Drawing.Icon.BmpFrame()
at System.Windows.Forms.ThreadExceptionDialog..ctor(Exception t)
at System.Windows.Forms.Application.ThreadContext.OnThreadException(Excep tion t)
at System.Windows.Forms.Control.WndProcException(Exception e)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Looking around the net for advice about the error comes up the with loads but, most of them go on about saving an image file, I'm not trying to do that.

The program is a MLE(Multi Level Editor) Map Editor which does not save Images it loads them in and yes free's them from memory if they have not been used after 5 minutes or so, I disable this feature but it still crashes.

It works for about 10 minutes or so and then crashes most annoying, I've tried SynLock when changing/accessing the Image used but this has not help much.

It randomly crashes in different parts I might be selecting a new tile to use or going up to the save menu to save the level I just cannot figure out a way to fit it.

Any advice wold be great.
Reply With Quote
  #2  
Old 09-27-2016, 09:29 AM
passel's Avatar
passelA generic error occurred in GDI+ passel is offline
Sinecure Expert

Super Moderator
* Guru *
 
Join Date: Jun 2003
Location: Upstate New York, usa
Posts: 8,024
Default

Is your memory usage or Handles or Threads numbers climbing in the Task Manager processes tab?
Perhaps you're not disposing of something that you're regularly creating and are running out of resources.
That is the typical scenario when a program runs for some generally nominal period of time and then crashes.
__________________
There Is An Island Of Opportunity In The Middle of Every Difficulty.
Miss That, Though, And You're Pretty Much Doomed.
Reply With Quote
  #3  
Old 10-09-2016, 05:10 PM
piggybank1974's Avatar
piggybank1974 piggybank1974 is offline
Ultimate Contributor
 
Join Date: Mar 2002
Location: weston-super-mare(UK)
Posts: 1,795
Default

Hi passel,

Forgot to turn on notifications so didn't see your post

No memory looks okay I would of though with 16mb of memory I'm fine it only uses about 65mb on average, it might be to do with accessing the bitmap at the same time it's getting destroyed or something I do have check in it though..
Reply With Quote
  #4  
Old 10-10-2016, 03:23 PM
passel's Avatar
passelA generic error occurred in GDI+ passel is offline
Sinecure Expert

Super Moderator
* Guru *
 
Join Date: Jun 2003
Location: Upstate New York, usa
Posts: 8,024
Default

Well, does it involve manipulating icons, since the exception seems to indicate it was in the process of drawing an icon when it got the exception.
__________________
There Is An Island Of Opportunity In The Middle of Every Difficulty.
Miss That, Though, And You're Pretty Much Doomed.
Reply With Quote
Reply

Tags
error, intptr, save, advice, crashes, loads, minutes, level, editor, hbitmap, image, occurred, synlock, feature, annoying, gdi+, disable, figure, menu, wold, fit, tile, randomly, selecting, generic


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
A generic error occurred in GDI+
A generic error occurred in GDI+
A generic error occurred in GDI+ A generic error occurred in GDI+
A generic error occurred in GDI+
A generic error occurred in GDI+
A generic error occurred in GDI+ A generic error occurred in GDI+ A generic error occurred in GDI+ A generic error occurred in GDI+ A generic error occurred in GDI+ A generic error occurred in GDI+ A generic error occurred in GDI+
A generic error occurred in GDI+
A generic error occurred in GDI+
 
A generic error occurred in GDI+
A generic error occurred in GDI+
 
-->