Overriding the default "file does not exist" error dialog.

-Patrick CaptainMorganRawks at gmail.com
Thu Aug 16 21:17:52 PDT 2007


I have a file that I am testing for when it is not found. As a result of 
it not being found I am receiving the dialog:

"Can't load image from file 'images/mypic.gif': file does not exist."

When I or a user hit OK to close the dialog the dialog flickers and 
never closes. I end up having to force quit the application. I thought 
of writing:

if (!bitmap.LoadFile(wxT("images/mypic.gif"), wxBITMAP_TYPE_GIF)) {
    wxMessageDialog(this, wxT("Problem loading image, please check 
resources."));
}

in the OnPaint() but it appears this if statement is ignored.

Am I making any sense? Can I override the dialog that never closes with 
the above? Or is there something else I am missing or another alternative?

Thanks,
-Patrick




More information about the wx-users mailing list