error handling sts strings LT_SUCCESS etc

For discussion of LizardTech's free Decode SDK for MrSID and JPEG 2000.

Moderator: jskiffington

error handling sts strings LT_SUCCESS etc

Postby chewiecat » Tue Jan 18, 2011 11:37 am

I am charged with upfitting our decoder to do at least a modicum of error handling so we can attempt proper carry on if there's a bad image or something.
Since the sts return strings aren't documented (as far as I can tell) and since I don't really want to return a string anyhoo (this is a dll return) can someone suggest a pattern for setting at least a true false return?
I tried to set a code based on (!LT_SUCCESS) but couldn't really get that to work.
I've seen the example where the sts is converted to a string:
// retrieve the formatted string
const char* str = getLastStatusString(sts);

is there a known always good string or something I can compare to in order to set a code?

Thanks for any suggestions.
Last edited by chewiecat on Tue Jan 18, 2011 1:22 pm, edited 1 time in total.
chewiecat
 
Posts: 7
Joined: Thu Aug 06, 2009 11:29 am

Postby ChrisH » Tue Jan 18, 2011 11:56 am

if you want to convert the LT_STATUS code to a simple 'true' (function succeeded) / 'false' (function failed) return, how about:

LT_STATUS sts = LTSomeFunc();
bool passed = LT_SUCCESS(sts));

Will this work for you?

-chris
ChrisH
 
Posts: 14
Joined: Tue Feb 12, 2008 10:20 am

Postby chewiecat » Tue Jan 18, 2011 1:35 pm

Humm.. that method seems to work pretty well ..I guess one of my mistakes was trying to check sts on things like a
nav->moveto . I backed some of these checks out and it seems to work better.

Might be nice to have all those strings documented or some error codes provided one day. For the most part even with large file sets we see no problem but when there is one it makes it difficult to pin down when there's no return code to speak of. Probably most of my issues are just from using an older version of the decoder anyhoo. So...hopefully the upgrade to sdk 7 (c++ v9) will fix them.
chewiecat
 
Posts: 7
Joined: Thu Aug 06, 2009 11:29 am


Return to SDKs

Who is online

Users browsing this forum: No registered users and 1 guest

cron