getResourceName() runtime errors

Code below gives me some R6010 runetime errors… is it the right way to get a resource name?

std::string outName = *CResourceHandler::get()->getResourceName(ResourceID("SPRITES/" + fileName));

Edit: I want to access TwCrPort.def

getResourceName give full name of file in filesystem that you can access via fopen() and such.
Files in archives can’t be accessed in this way. This is why this function returns boost::optional - it may not contain any value.

If you need to know filename then you already have it: fileName.
What you’re trying to do here?

FYI - this is Visual Studio-specific error code. I have no idea what this means.

You are right… I was overcoding that part.