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
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?
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
Eric
RE: how do i find PDMWorks .dll path?