AnsweredAssumed Answered

GetLocalVersionNo Returns -1

Question asked by Brian Bollmann on Jul 22, 2016
Latest reply on Aug 1, 2016 by Brian Bollmann

Greetings!

I've copied/written the code below which works fine on a VMware 64-Bit 'full-machine' w/ SolidWorks Explorer installed.

When I copy the program over to a VMware 64-Bit Virtual Sierver w/ Solidworks Explorer installed, the GetLocalVersionNo command returns a -1 and the code fails.

 

Can you point me in the right direction?

 

 

                    IEdmVault5 vault1 = new EdmVault5();
                    if (vault1 == null)
                    {
                        vault1 = new EdmVault5();
                    }
                    if (!vault1.IsLoggedIn)
                    {
                        //Log into selected vault as the current user
                        vault1.LoginAuto("SLMP-Sparta", Handle.ToInt32());
                    }


                    string rootPath1 = vault1.RootFolderPath;


                    // Get the File
                    IEdmVault7 vault2 = null;
                    if (vault1 == null)
                    {
                        vault1 = new EdmVault5();
                    }
                    vault2 = (IEdmVault7)vault1;
                    if (!vault1.IsLoggedIn)
                    {
                        //Log into selected vault as the current user
                        vault1.LoginAuto("SLMP-Sparta", Handle.ToInt32());
                    }


                    string rootPath2 = vault2.RootFolderPath;




                    // Get a Handle on the File
                    IEdmFile9 aFile = default(IEdmFile9);
                    IEdmFolder5 ppoRetParentFolder;
                
                    string strPartNumber = readMATRIX["ITEM_CODE"].ToString();
                
                    // For Debugging
                    strPartNumber = "32061-0348.pdf";


                    aFile = (IEdmFile9)vault2.GetFileFromPath(rootPath1 
                        + @"\Material Inventory Prints\" + strPartNumber, out ppoRetParentFolder);


                    
                    // If the file was found, continue
                    if (aFile != null)
                    {
                        string saveFileName = @"C:\Temp\" + aFile.Name;


                        // Delete the C:\Temp\ version if it exists
                        if (System.IO.File.Exists(saveFileName))
                        {
                            System.IO.File.Delete(saveFileName);
                        }


                        // Find the latest version and save it to C:\Temp\
                        IEdmEnumeratorVersion5 verEnum;
                        verEnum = (IEdmEnumeratorVersion5)aFile;
                        
                        int intVersion = 0;
                        intVersion = aFile.GetLocalVersionNo(ppoRetParentFolder.ID);
                        
                        IEdmVersion5 ver;
                        
                        ver = verEnum.GetVersion(intVersion);
                        ver.GetFileCopy(Handle.ToInt32(), saveFileName, 0);

 

Thanks!

Outcomes