5 Replies Latest reply on Jan 23, 2013 10:27 AM by Hristo Daskalov

    Use of GetLoggedInWindowsUserID

    Tom Thompson

      I'm trying to capture the Rename File event in EPDM 2010 and then getting the UserID of the person doing the rename.  I'm using this VB.Net code:

       

          Public Sub OnCmd(ByRef poCmd As EdmCmd, ByRef ppoData As System.Array) Implements IEdmAddIn5.OnCmd

       

              If poCmd.meCmdType = EdmCmdType.EdmCmd_PreRename Then

       

                  Dim vault As IEdmVault11 = poCmd.mpoVault

       

                  For Each cmdDatum As EdmCmdData In ppoData

                      ‘...

                      Dim id As Integer = vault.GetLoggedInWindowsUserID(vault.Name)

                      ‘...

       

      But the code bombs because of the call to GetLoggedInWindowsUserID.  (If I comment this line out, it runs fine.)  The error I get is:

       

      EPDMError.jpg

       

      We are not using Windows to manage our logins, we are using Enterprise PDM logins.

       

      Am I calling this wrong?  Any other ideas?  Thanks!

        • Re: Use of GetLoggedInWindowsUserID
          Tom Thompson

          Well, I changed the third line to:

          Dim vault As IEdmVault5 = poCmd.mpoVault

           

          and now it works!

          How could this be?!?!  The help file lists the function as:

          IEdmVault11::GetLoggedInWindowsUserID

          and IEdmVault11 should inherit from IEdmVault5, so why didn't it work?

            • Re: Use of GetLoggedInWindowsUserID
              Jeff Sweeney

              IEdmVault11 didn't exist until 2010. Could you be using an old Interop?

                • Re: Use of GetLoggedInWindowsUserID
                  Tom Thompson

                  Well, maybe.

                   

                  Here's my only reference to EdmLib:

                  Capture.JPG

                  However, when I debug and I do a "Quick Watch" on poCmd, I get a message saying "The project currently contains references to more than one version of Interop.EdmLib, a direct reference to version 5.13.0.0 and an indirect reference (through 'EdmCmd') to version 5.14.0.0. Change the direct reference to use version 5.14.0.0 (or higher) of Interop.EdmLib."

                   

                  I have no idea why it is saying this, I only have one reference to EdmLib.  I do reference SWDocumentMgr, maybe that indirectly references 5.13 of EdmLib?

                   

                  Thanks!

                    • Re: Use of GetLoggedInWindowsUserID
                      Jeff Sweeney

                      I honestly don't know....I suppose the next thing I would try would be to remove the EdmLib reference, delete the "bin" and "obj" directories, add the references back in, then recompile. This would ensure everyone is using the same interop.

                       

                      Another thing...make sure you are not using any commands/methods that are not yet supported in EPDM 2010. I've accidentally used a 2012 call in a 2011 application and received a similar message.

                        • Re: Use of GetLoggedInWindowsUserID
                          Hristo Daskalov

                          I have the same problem right now with 2013 and the message is "The project currently contains references to more than one version of Interop.EdmLib, a direct reference to version 5.13.0.0 and an indirect reference (through 'EdmCmd') to version 5.16.0.0. Change the direct reference to use version 5.16.0.0 (or higher) of Interop.EdmLib.".

                          I use commands/methods for defining of EPDM tasks. I removed the EdmLib reference, deleted the "bin" and "obj" directories and then recompiled the add-in, but without successes. The reference to  the version 5.13.0.0 of EdmLib remains ...

                          Any solitions?

                           

                          Thanks!