2 Replies Latest reply on May 30, 2018 5:24 AM by Chiara Ottaviani

    Solidworks 2018 SwDocumentMgr.dll for 32 bit

    Jess Darres

      Recently I installed Solidworks 2018 and updated the SwDocumentMgr license key. I found the SwDocumentMgr.dll only in 64bit, it is not updated in 32 bit.

      My application is developed in 32 bit.

      I tried to use this SwDocumentMgr.dll (2018) in my c++ application (32-bit), I can able to open 2017 SolidWorks models. but can't able to open 2018 models.

      when I debug the code, I got the error in below code,

            SwDmDocumentOpenError error;

            ISwDMDocumentPtr pswDoc(pswDocMgr->GetDocument(szFile, swDmDocumentPart, TRUE, &error) );

      After this line, I got the value "6" in error.

      swDmDocumentOpenErrorFutureVersion6 = File was created in a version of SOLIDWORKS more recent than the version attempting to open the file

      Note: I installed visual c++ redistributable for 2015, registered SwDocumentMgr.dll (C:\Program Files\Common Files\SOLIDWORKS Shared)

      and used the 2018 license key.

      Can I use this SwDocumentMgr.dll (2018) in my 32-bit application? or anything wrong here?

       

      Thanks,

      Darres

        • Re: Solidworks 2018 SwDocumentMgr.dll for 32 bit
          Jess Darres

          SwDocumentMgr.dll (2018) is working for 64-bit application only. It won't support the 32-bit application.

            • Re: Solidworks 2018 SwDocumentMgr.dll for 32 bit
              Chiara Ottaviani

              Well, it is true that starting from SW2018 the key component SwDocumentMgr.dll

              is compiled as 64bit only, but it can still be consumed by legacy COM applications

              using the DLL Surrogate technique.

              Registering the DLL Server for Surrogate Activation (COM)

               

              You should add up two registry keys in order to enable DLL surrogate to work.

              Windows will still get an instance of the 64bit component using a "proxy" that

              allow old 32bit code to still work when using a regular COM interface binding.

               

              Tested on SW2018 SP2

               

              Windows Registry Editor Version 5.00

               

              [HKEY_CLASSES_ROOT\AppID\{6724B21E-CD3A-4451-8F25-8A8E7E1F4EBB}]

              "DllSurrogate"=""

               

              [HKEY_CLASSES_ROOT\CLSID\{00AB5D8D-2B8F-416b-9761-92FACC8872BE}]

              "AppID"="{6724B21E-CD3A-4451-8F25-8A8E7E1F4EBB}"

               

               

              I was able to restore the Sw2017 behaviour using the keys above (no need to restart).

              Please verify with Regedit that CLSID {00AB5....72BE} really points to a COM component

              ProgID named "SwDocumentMgr.SwDMClassFactory.1"

               

              Most probably i'm the first that succeed in restoring legacy applications under SW2018.

              Hope this helps the SW community,

               

              Paolo Marani