Solved

Error during Debug of application - GDI+ is not properly initialized

Posted on 2004-07-30
7
1,074 Views
Last Modified: 2008-01-09
I have a VB.Net client application.  When I run it in debug mode it works fine but when I go to exit the application to get out of debug and back to the development screen I get this error:

An unhandled exception of type 'System.Runtime.InteropServices.ExternalException' occurred in system.drawing.dll

Additional information: Internal error: GDI+ is not properly initialized.


I looked around the web and saw something that indicated that any file serialization "Close" calls needed to be removed.  This does not make sense to me since I do not have a file open during development.

Any help would be GREATLY appreciated,

Hammer
0
Comment
Question by:HAMMER33333
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
7 Comments
 
LVL 8

Expert Comment

by:bramsquad
ID: 11677863
its not talking about closing a file, but closing an object.  can you post your code?
0
 

Author Comment

by:HAMMER33333
ID: 11679635
It is proprietary so I can't post the code.  Also it is a large amount of code.

However, you do put me onto a great idea.  I will check around at the objects.  What sort of object would this be?  A form, connection to a database, a webservice?

I am basically running the App in debug mode, clicking on the "x" in the upper right hand corner to close it down and I get this error.  If I click "Continue" when the error comes up it brings me back to my .Net developer solution screen.

Thanks for the help,

Hammer
0
 
LVL 8

Expert Comment

by:bramsquad
ID: 11679828
this website makes a lot of sense of the situation

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbtskmanipulatingimageswithgdi.asp

i think what you have is someone rendering a drawing surface.  

what could possibly happen is they have a handled exception at initialization (for instance if the .bmp file does not exist, dont initialize) then when the close call comes, the program never opened it, so it returns your error.

thats one possibility, it could be a few different reasons why youre getting your error.

is this professionally written software?  if so, id get a hold of the company.  if this is written by someone you know, get a hold of them and tell them to look into this error.

~b
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:HAMMER33333
ID: 11679877
I can show you the below code.  The program starts by running the module "ModuleDeclareForms".  The FfrmMain is created and displayed to the user in the "main" routine below.  I ran the debugger on this and when the user clicks the "x" in the upper right hand corner the code the code drops out of the "FfrmMain.ShowDialog()" goes to the "End Sub" and shortly after that the error appears.  Is there some other ending an application?

Thanks again,
Hammer


Module ModuleDeclareForms

    Public FfrmMain As New frmMain()
    Public FfrmLogin As New frmLogin
    Public FfrmGetEmail As New frmGetEmail()
    Public FfrmAgentState As New frmAgentState()
    Public FfrmAbout As New frmAbout()
    Public FfrmClose As New frmClose
    Public FfrmSuspended As New frmSuspended()
    Public FfrmAgentProperties As New frmAgentProperties



    Sub main()

        FfrmMain.ShowDialog()

     End Sub

End Module
0
 

Author Comment

by:HAMMER33333
ID: 11694813
bramsquad,

       How do you find something like that?   I have tried Try/Catch, looking for GDI instances, bad file names, and cannot find anything.  We are using the new Component One icons.  Could that have anything to do with it?

Thanks again,

Hammer


0
 
LVL 8

Accepted Solution

by:
bramsquad earned 200 total points
ID: 11787703
sorry this took me a while....

well your problem has nothing to do with the above code.  the error in question is in an event handler within the main form.  

ive never figured out why, but i know that combo boxes trigger the "SelectedIndexChanged" event before even the form_load event! -- you should try it, create a test app with a combo box and put msgbox("hello") in that event

where im going with this, is that on close there might be an event that gets activated somewhere....other than that, i really dont know what better direction to point you in.

best of luck, let me know if you have any more problems i can help with

~b
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question