All regular app error messages are redirected to a log window -> wxTextCtrl.
The problem I am running into for some large image files, mainly 50 - 100 MB TIF files, is, that the image handler code does not succeed in allocating enough memory and the call img.IsOk() fails. but without much feedback unless I can intercept the output from wxLogError somehow. (And yes, I understand some of these files could be reduced in size by compression - but that is not an option at this stage)
Can I wrap the block which calls img.IsOk() with some sort of special wxLog target or can I somehow inspect the redirected log output at run time to get a better handle on what size will cause trouble and provide more meaningful feedback for the user?
The basic code abstract looks like:
Code: Select all
wxMemoryInputStream mis( fileBuffer, fileSize.ToULong() );
fsImage image( mis );
if( image.IsOk() )
{
.. handle the successful case
}
else // if( !image.IsOk() )
{
.... handle the problem cases with proper feedback
and here is where I would like to get the string passed to wxLogError or wxLogWarning .....
}