I have some code in a EdmCmd_PostState event handler that works as expected. The code checks out the file, uses IEdmBatchUpdate2 to update 2 variables, calls CommitUpdate and then checks the file back in. This works. If I takes the same code and cut and past it into the EdmCmd_PreState event handler, the call to CommitUpdate fails with error code -2147220976 (The file isn't checked out by you, which is required by the operation).
Why would PreState and PostState be different? It seems like certain things are allowed in one but not the other, but these restrictions aren't documented anywhere.
Both PreState and PostState are now throwing the error. Interestingly, the cause seems to be a file that is listed as checked out, but the 'Checked Out In' column in Explorer is empty. How does that happen?