×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

how do i find PDMWorks .dll path?

how do i find PDMWorks .dll path?

how do i find PDMWorks .dll path?

(OP)
I'd like to add a button to turn the PDMWorks addin on and off so we can share licenses better...I have code that works fine for this on my box but I must make it universal.  Looks like there are several places that the addin .dll could be located, especially with XP64 boxes.  How can I find this live so that the program runs no matter where the .dll was installed?

Thanks!


My code below;

  Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        Dim SWAPP As Object
        Dim RetVal As Long
        Const strAddInPath As String = "C:\Program Files\SolidWorks\PDMWorks Client\pdmwaddin.dll"


        '   SWAPP = Application.SldWorks
        SWAPP = GetObject(, "SldWorks.Application")
        If Not SWAPP Is Nothing Then
            RetVal = SWAPP.LoadAddIn(strAddInPath) 'Load Add in
            If RetVal = 2 Then 'add in already loaded
                'Unload the add in
                SWAPP.UnloadAddIn(strAddInPath)
            End If
        End If


RE: how do i find PDMWorks .dll path?

You should be able to extract the path from the registry.  I looked in my registry and found the path at the following location:
HKEY_CLASSES_ROOT\CLSID\{71AD751E-7226-4843-809A-E568E5A494D9}\InprocServer32

The long string, 71AD751E-7226-4843-809A-E568E5A494D9, is what is known as a globally unique ID (GUID) and is a class ID (CLSID) in this context.  It should be consistent across machines within a version or service pack.  It may even remain the same across versions.

There also appears to be a VersionIndependentProgID associated with this CLSID, which is PdmwAddin.pdmwAddinApp.  I did another search and found that string at: HKEY_CLASSES_ROOT\PdmwAddin.pdmwAddinApp.  It has a CLSID sub key which matches the above CLSID.  It also has a CurVer sub key with value of PdmwAddin.pdmwAddinApp.1.  There exists an HKEY_CLASSES_ROOT\PdmwAddin.pdmwAddinApp.1\CLSID entry which has the same value.

The following appears to be the most robust way of obtaining the path:
Get the value of: HKEY_CLASSES_ROOT\PdmwAddin.pdmwAddinApp\CurVer.  I will refer to that as current_version.
Get the value of: HKEY_CLASSES_ROOT\current_version\CLSID.  I will refer to that as clsid.
Get the value of: HKEY_CLASSES_ROOT\CLSID\clsid\InprocServer32.  This should be the path that you are after.

I have not worked with accessing registry values from VB, but http://www.windowsdevcenter.com/pub/a/windows/2004/07/27/VB_Registry_Values.html looks like a good article on the topic.

Eric

RE: how do i find PDMWorks .dll path?

(OP)
Thanks, Eric!  That's a good start for me.  A star for you.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources