How should Error Status Code returned from a DLLImport function be handled?
I am thinking defining a different function that wrap it and throw exception.
Or should I just use the function as is?
5 Replies
From what I've seen, ppl use enums for the error codes, with 0 being success
eg.
https://github.com/CorsairOfficial/cue-sdk/blob/master/src%2Finclude%2FiCUESDK.h#L22
Is there any specific practice regarding using the function when imported it in your app?
Like should I make a function to wrap it and throw exception with the error code, if it isnt zero?
You could if necessary. It's what I've done in some of my wrapper libs
Unknown User•8mo ago
Message Not Public
Sign In & Join Server To View
Thanks yall.