I am writing some validation in the updateparameters method of my custom geoprocessing tool. I need to post an error message when specific conditions exists and I would like to include a standard esri error code with my message. I have the logic worked out and my error message posting but I must not be using the error code correctly because no mater what number I use for the error code, it displays as -1.
I would like it to display error code 427.
This is the simplified code setting the error message.
public void UpdateMessages(IArray paramvalues, IGPEnvironmentManager pEnvMgr, IGPMessages Messages)
{
Messages.ReplaceError(5, 427, "You're doing it wrong.");
return;
}