I am working on a program that allow the user to navigate previews of files in a folder. I am working on adding the Solidworks PDM API to my program so they can view files in the vault the issue i am having is when i get to the PDMSel.mlProjID = PDMFolder.ID; and PDMSel.mlDocID = PDMFile.ID; commands is stops mid program and goes back to the form.
This is what my form looks like
and this is the part of code im having the issue with and when i run the code line by line when i get to the PDMSel.mlProjID = PDMFolder.ID; command it stops and goes back to the form.
vault1 = new EdmVault5();
PDMFile = vault1.GetFileFromPath(myFile, out PDMFolder);
PDMSel.mlProjID = PDMFolder.ID;
PDMSel.mlDocID = PDMFile.ID;
PDMBatchGet = vault1.CreateUtility(EdmUtility.EdmUtil_BatchGet);
PDMBatchGet.AddSelection((EdmVault5)vault1, ref PDMSel);