Getting the version of a checked out file

Hi,
When I try to get the version of a checked out file (in my case a SLDPRT file) using the PDM API for C#, i get a version = -1.
This is my code:
 

   string PROJECT_NAME = "MY PROJECT";
   IEdmPos5 pos = fileReference.GetFirstChildPosition3(PROJECT_NAME, false, true, (int)EdmRefFlags.EdmRef_File, string.Empty, versionNum);
   IEdmReference10 childReference;
   while (pos.IsNull == false)
   {
       childReference = (IEdmReference10)fileReference.GetNextChild(pos);
   }

 

But I get childReference.VersionRef = -1.

Does anybody know why it happens and how I can get the correct version of the checked out file?

thanks!