Re: MessageBox completely blank?
Actually - you raised a good point here MH.
Are you calling the Dispose() on all your GDI+ objects ?
If you're not, then you're asking for trouble. It's entirely possible (and unpredicatable) what behaviour you see when you have a huge number of GDI resources allocated to the application.
You MUST release GDI resources (e.g. Font, Brush, Pen etc classes) whenever you're finished with them.
You do this by calling the Dispose() method on them, or by the "using" keyword which I've written an article about :
http://www.codeguru.com/Csharp/Cshar...cle.php/c8679/
It may just be that you're running out of resources.
To check all you really need to do is to run task manager, processes tab and after selecting the "view/select columns" menu item make sure "GDI objects" is selected.
You can then keep track of all GDI objects in the system - if the number is growing and never decreasing then you've got a problem.
I don't know, but I'd be willing to bet the maximum GDI resource allocations will differ between machines, and certainly OSes.
I'm always very tidy with my GDI resources : I always release them after using them unless I'm explicitly caching them for speed reasons. Maybe that's why I haven't seen your problems.
Another thing to check is running under MTAThread rather STAThread. I've had problems with MTAThread (mainly with the common dialogs) but there may be other problems which I've not experienced.
Darwen.
Re: MessageBox completely blank?
I've run the message box from both P/Invoke and through the one provided in System.Windows.Forms. I want to test it with straight win32 code and see if it has the same result.
I have a feeling its .net's implementation somewhere. the win32 tests should show that. It seems to be associated with the app as it loads not adhoc as its running (as enable/disabling the b/o has no effect on the app after its started).
I've had system font problems before and know that everythings not on the up and up there, so that will be my first place I look.
Re: MessageBox completely blank?
Thanks darwen.
I run Windows Update regulary and in fact just updated on Tuesday (there were new updates). I keep it turned on to tell me when there are new updates available.
I hope I can find a solution in this thread, as the application I'm beginning with (from a MS book) is extremely simple and doesn't include using bunches of resources or such.
I hope the simple needs I have at this point don't get lost with MH's problem, but hopefully both can be resolved.
I was thinking of having the IT folks turn off my McAfee for 10 minutes this morning so I can test.
Re: MessageBox completely blank?
Just tried it on my home desktop (Norton for antivirus) and it's ok here too... Very strange.
Re: MessageBox completely blank?
I have only had the problem happen with the new v8 of mcafee.
Re: MessageBox completely blank?
That's an interesting note about v8 - as a matter of fact, that's what we have. I'll check into it.
Thanks.
Re: MessageBox completely blank?
Link to McAfee's KB. I guess its a bug in gdi+. there's a link to a hotfix in the article.
Re: MessageBox completely blank?
Thanks for the link... I disabled the McAfee, but it didn't make any difference.
I sent the link to our IT department to see if they can help resolve the issue.
Re: MessageBox completely blank?
Good News!!! (no, it's not GEICO)
I adjusted McAfee 8.0i through the console to disbale buffer overflow checking, and all the problems have disappeared. (Didn't have to apply any patches).
I notified IT, so we'll see what they have come up with.
Thanks again to all who helped.