3 Replies Latest reply on Sep 7, 2016 7:31 PM by Rick Davin

    AFWrapper activex component can't create object

    sylpiette

      Hi,

       

      I'm using the AFWrapper Library to link Processbook and AF elements.

       

      Everything works fine on my development system, either in Debug and Release. However, when I try to export the AFWrapper.dll and AFWrapper.tlb on another computer, I get the "Run-time error '429' ActiveX component can't create object" error message.

       

      In all my dpi files, I've unselect the reference to the Library (AFWrapper), then browsed for the .tlb where it is located (C:\Program Files (x86)\PIPC\Procbook). When I execute the code in Processbook (in fact in the VBA Editor), I always get this error message at the line : Set myAFW = New AFWrapper.Wrapper.

       

      Both computers are running Windows7, 64-bit.

       

      Any idea ?

        • Re: AFWrapper activex component can't create object
          Rick Davin

          On  the newer computer, did you also register the AFWrapper assembly using RegAsm.exe?

           

          Possible locations:

           

          C:\Windows\Microsoft.NET\Framework\v2.0.50727\RegAsm.exe

           

          C:\Windows\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe

           

          Register it with:

           

          regasm "%PIHOME%\ProcBook\AFWrapper.dll" /tlb

            • Re: AFWrapper activex component can't create object
              sylpiette

              Hi Rick,

               

              thanks for the quick answer.

               

              Yes, I've registered it using the C:\Windows\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe.

               

              I've also tried with (and without) "/codebase" option.

                • Re: AFWrapper activex component can't create object
                  Rick Davin

                  Hi Sylvain,

                   

                  I can't duplicate your issue on my Windows 10 computers.  Here are the steps I performed:

                   

                  1. Copied the AFWrapper.dll and .tlb files to %PIHOME%\ProcBook.
                  2. Tried running the WrapperExample.PDI to receive the "Run-time error '429' ActiveX component can't create object" error message, which was to be expected.
                  3. Open Command Prompt aka CMD window BUT I right-clicked on the icon and chose to "Run as administrator".
                  4. From the C:\WINDOWS\system32> prompt, I changed directories: cd C:\Windows\Microsoft.NET\Framework\v4.0.30319
                  5. From the C:\Windows\Microsoft.NET\Framework\v4.0.30319> prompt, I ran: regasm /codebase "%PIHOME%\ProcBook\AFWrapper.dll" /tlb
                  6. I read, and then ignored, these ugly messages:
                    Microsoft .NET Framework Assembly Registration Utility version 4.6.79.0

                          for Microsoft .NET Framework version 4.6.79.0

                          Copyright (C) Microsoft Corporation.  All rights reserved.

                   

                  RegAsm : warning RA0000 : Registering an unsigned assembly with /codebase can cause your assembly to interfere with other applications that may be installed on the same computer. The /codebase switch is intended to be used only with signed assemblies. Please give your assembly a strong name and re-register it.

                  Types registered successfully

                  Assembly exported to 'C:\Program Files (x86)\PIPC\ProcBook\AFWrapper.tlb', and the type library was registered successfully

                     7. Finally, I opened WrapperExample.PDI once again and everything worked fine.

                   

                  Past experience with RegAsm makes me want to unregister an assembly before re-registering it.  Since this was my first time to register the assembly on this host, that precaution was not needed.  However, that command would look something like:

                   

                  regasm /unregister "%PIHOME%\ProcBook\AFWrapper.dll"

                   

                  But again that would be in a CMD window that I opened with "Run as administrator".

                   

                  Hope this helps,

                  Rick

                  1 of 1 people found this helpful