Solved

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

Posted on 2004-07-30
7
1,069 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
  • 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
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…

932 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now