6 Replies Latest reply on Aug 10, 2016 1:20 PM by k-brady1

    Getting error message Cannot create ActiveX component when calling CreateObject

    k-brady1

      Does anyone know why I'm getting this error? I am using VX.1.1 and Visual Studio 2013. I can successfully execute visual basic using mgcscript. Thank you.

        • 1. Re: Getting error message Cannot create ActiveX component when calling CreateObject
          andrew.french

          you need to start the IDE using the mglaunch.exe

           

          you can create an environment variable for it

          C:\MentorGraphics\<version>\SDD_HOME\common\win64\bin\mglaunch.exe

           

          and then create a batch file that launches your IDE

          %mglaunch% "C:\Path\to\your\project.sln"

          • 2. Re: Getting error message Cannot create ActiveX component when calling CreateObject
            k-brady1

            Hi Andrew,

             

            That was the problem. I had some utilities built with EE7.9.5 that didn't

            require this. This is my first build with a VX release. Will need to look

            into what mglaunch actually does. Thank you so much for your help!!

             

             

              Best Regards,

             

              Kathy J Brady

             

              Principal Software Design Engineer

              Engineering Solutions

              Global Business Services

              Raytheon Company

              +1 972.643.9738  (office)

              +1 972.643.6855   (fax)

              k-brady1@raytheon.com

             

              1717 E CityLine Dr.

              Richardson, TX 75082

              www.raytheon.com

             

              Follow Raytheon On

              Twitter YouTube Facebook LinkedIn

              Dual Band podcasts

             

              Raytheon Sustainability

             

              This message contains information

              that may be confidential and

              privileged. Unless you are the

              addressee (or authorized to receive

              mail for the addressee), you should

              not use, copy or disclose to anyone

              this message or any information

              contained in this message. If you

              have received this message in error,

              please so advise the sender by reply

              e-mail and delete this message.

              Thank you for your cooperation.

            • 3. Re: Getting error message Cannot create ActiveX component when calling CreateObject
              andrew.french

              All credit goes to Patrick Cashman on here.  I was banging my head on this one for way longer than I should have been and he helped me out big time.  Just paying it forward at this point.

              • 4. Re: Getting error message Cannot create ActiveX component when calling CreateObject
                k-brady1

                Big Thank you to Patrick Cashman too!. Looked up mglaunch.exe and it is

                related to the changes between EE7.9.5 and the VX releases because

                environment variables are no longer defined. Thank you so much!

                 

                  Best Regards,

                 

                  Kathy J Brady

                 

                  Principal Software Design Engineer

                  Engineering Solutions

                  Global Business Services

                  Raytheon Company

                  +1 972.643.9738  (office)

                  +1 972.643.6855   (fax)

                  k-brady1@raytheon.com

                 

                  1717 E CityLine Dr.

                  Richardson, TX 75082

                  www.raytheon.com

                 

                  Follow Raytheon On

                  Twitter YouTube Facebook LinkedIn

                  Dual Band podcasts

                 

                  Raytheon Sustainability

                 

                  This message contains information

                  that may be confidential and

                  privileged. Unless you are the

                  addressee (or authorized to receive

                  mail for the addressee), you should

                  not use, copy or disclose to anyone

                  this message or any information

                  contained in this message. If you

                  have received this message in error,

                  please so advise the sender by reply

                  e-mail and delete this message.

                  Thank you for your cooperation.

                • 5. Re: Getting error message Cannot create ActiveX component when calling CreateObject
                  Patrick.Cashman

                  You can use the following in a vbs script file to get the mglaunch path real time without regard to changes in system settings or installed releases:

                   

                  Option explicit

                   

                  run

                   

                  sub run()

                       Dim objShell, regkey, mglaunch

                      

                       Set objShell = CreateObject("WScript.Shell")

                       regkey = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\mglaunch.exe\"

                       mglaunch = objShell.RegRead(regkey)

                       mglaunch = mglaunch & " " & chr(34) & "full path to your .sln or exe file" & chr(34)

                       objShell.run mglaunch

                      

                       set objShell = Nothing

                  End sub

                   

                  Just put the above into a .vbs file, chance the path to suit your needs, and double-click the vbs file.

                   

                  Just saves the step of having to remember to update the mglaunch environment variable, such as when you deploy to many users, get new PCs, etc.   I use the same script to launch any executables that require mglaunch at startup.  FYI these are any that use the CreateObject syntax in starting a new instance of one of the Mentor VX tools from scratch, as opposed to hooking to an existing open session of one of the tools.  When there is an already-open session of a tool, GetObject is used instead of CreateObject, and mglaunch is not needed to invoke the automation hook.

                   

                  No, this is not covered in the Mentor documentation, except obliquely where is says the information can be found in the registry.

                  • 6. Re: Getting error message Cannot create ActiveX component when calling CreateObject
                    k-brady1

                    I will give this a try. Thank you so much for your help!

                     

                      Best Regards,

                     

                      Kathy J Brady

                     

                      Principal Software Design Engineer

                      Engineering Solutions

                      Global Business Services

                      Raytheon Company

                      +1 972.643.9738  (office)

                      +1 972.643.6855   (fax)

                      k-brady1@raytheon.com

                     

                      1717 E CityLine Dr.

                      Richardson, TX 75082

                      www.raytheon.com

                     

                      Follow Raytheon On

                      Twitter YouTube Facebook LinkedIn

                      Dual Band podcasts

                     

                      Raytheon Sustainability

                     

                      This message contains information

                      that may be confidential and

                      privileged. Unless you are the

                      addressee (or authorized to receive

                      mail for the addressee), you should

                      not use, copy or disclose to anyone

                      this message or any information

                      contained in this message. If you

                      have received this message in error,

                      please so advise the sender by reply

                      e-mail and delete this message.

                      Thank you for your cooperation.