Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Recent
    • Tags
    • Users
    • Login

    QTCF.dll Issues [Solved]

    Scheduled Pinned Locked Moved PYTHON Development
    10 Posts 0 Posters 734 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H Offline
      Helper
      last edited by

      On 27/10/2014 at 17:52, xxxxxxxx wrote:

      I seem to be having some issues with the qtguiagent.exe file. Using python I am launching a powershell script to kill Cinema 4D, swap plugins and then restart Cinema. The issue I have is when I am restarting cinema. I get a:

      "QTCF.dll is missing from your computer. error"

      On my local testing machine everything runs fine if I place the QTCF.dll in the main cinema folder. Has anyone run into this problem? Each machine is using windows 8.1 and I am guessing (A big guess) that the issue is when killing Cinema the qtguiagent.exe is not being completely killed? I have also tried adding that to the powershell code but no luck.

      Would it also have to do with using subprocess to call powershell? This is how I set it up:

      subprocess.Popen([PowershellPath,'-ExecutionPolicy','Unrestricted',CodeFromCinemaToRunInPS])
      

      does Being a subprocess hold back the completion of the process killing? If so how should something like this be handled?

      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        On 28/10/2014 at 00:45, xxxxxxxx wrote:

        Originally posted by xxxxxxxx

        I seem to be having some issues with the qtguiagent.exe file. Using python I am launching a powershell script to kill Cinema 4D, swap plugins and then restart Cinema. The issue I have is when I am restarting cinema. I get a:

        "QTCF.dll is missing from your computer. error"

        On my local testing machine everything runs fine if I place the QTCF.dll in the main cinema folder. Has anyone run into this problem? Each machine is using windows 8.1 and I am guessing (A big guess) that the issue is when killing Cinema the qtguiagent.exe is not being completely killed? I have also tried adding that to the powershell code but no luck.
        Would it also have to do with using subprocess to call powershell? This is how I set it up:

        subprocess.Popen([PowershellPath,'-ExecutionPolicy','Unrestricted',CodeFromCinemaToRunInPS])
        

        does Being a subprocess hold back the completion of the process killing? If so how should something like this be handled?

        "QTCF.dll" is a dll of Quicktime's installation, not of Cinema or the qtguiagent (and neither of them loads this dll directly). Chances are that your restart mechanism (or the libs/shells involved with it) fiddles with the start path or the environment of Windows in a way that QuickTime can't find its own dlls. I think that 's the direction you should have a look at...

        Best regards,

        Wilfried

        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

          On 28/10/2014 at 07:41, xxxxxxxx wrote:

          Thanks for the input Wilfried.

          The restart happens when I use python to write a ps1 file (powershell) and run it using subprocess. The code for the restart running in powershell is:

          Start-Process 'C:\Program Files\MAXON\Cinema R16\CINEMA 4D.exe'
          

          This works completely fine when running strait through powershell, no Cinema involved, and runs without error. As soon as I run the same code but this time through Cinema I get the error.

          What makes me wonder is how some of the computers won't have this problem while others will. (The setup and program versions are all the same(latest))

          When I get the chance I will post a simple version of the script to see if any of you can figure it out.

          1 Reply Last reply Reply Quote 0
          • H Offline
            Helper
            last edited by

            On 28/10/2014 at 11:43, xxxxxxxx wrote:

            Ok here is the script stripped down:

            import c4d, subprocess,os,sys
            from c4d import gui
              
            # Get Cinemas Process ID for murder
            PID = str(os.getpid())
              
            # Cinema's EXE file for restart
            app = ("'"+c4d.storage.GeGetStartupApplication()+"'")
              
            # Get users document path
            DocPath = c4d.storage.GeGetC4DPath(c4d.C4D_PATH_MYDOCUMENTS)
              
            # Check and create a powershell file in your documents path
            if not os.path.exists(DocPath+"\C4D_Restart.ps1") :
                f = open(DocPath+"\C4D_Restart.ps1","w")
                f.write("")
                f.close()
            else:
                pass
              
            # Path to Powershell program
            PSPath = r'C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exe'
              
            # path to the created code.
            Wpath = r""+DocPath+"\C4D_Restart.ps1"
              
            # Code to write into the Powershell file.
            ps1 = r"Stop-Process "+PID+"\nStart-Sleep -Seconds 2\n\nStart-Process "+app+"\n"
              
            # Write to powershell file
            f = open(Wpath,"w")
            f.write(ps1)
            f.close()
              
            # Run powershell
            subprocess.Popen([PSPath,'-ExecutionPolicy','Unrestricted',Wpath])
            

            You may need to enable Powershell's scripts to run buy running Powershell as admin and run this:

            set-executionpolicy unrestricted
            
            1 Reply Last reply Reply Quote 0
            • H Offline
              Helper
              last edited by

              On 28/10/2014 at 13:59, xxxxxxxx wrote:

              If you start and stop processes like that, you may run into problems. Take a look in task manager after you run this script a few times, there's a good chance you have multiple instances of qtguiagent.exe running. That could be the cause of the problem.

              I really wouldn't force a process to halt in that way - better to find a way to make Cinema shut down correctly.

              1 Reply Last reply Reply Quote 0
              • H Offline
                Helper
                last edited by

                On 29/10/2014 at 03:42, xxxxxxxx wrote:

                Originally posted by xxxxxxxx

                If you start and stop processes like that, you may run into problems. Take a look in task manager after you run this script a few times, there's a good chance you have multiple instances of qtguiagent.exe running. That could be the cause of the problem.

                I really wouldn't force a process to halt in that way - better to find a way to make Cinema shut down correctly.

                No that doesn't matter. Each instance of Cinema starts its own qtguiagent (it 's necessary due to the single-threaded nature of QT). If the Cinema process is killed without properly ending the qtguiagent, this qtguiagent will wait for pipe input without ever getting data but it won't conflict with newer instances of Cinema or other qtguiagents (so nothing to worry about).

                Best regards,

                Wilfried

                1 Reply Last reply Reply Quote 0
                • H Offline
                  Helper
                  last edited by

                  On 29/10/2014 at 03:49, xxxxxxxx wrote:

                  Originally posted by xxxxxxxx

                  Thanks for the input <span style="line-height: 16.7999992370605px; : rgb248, 248, 252;">Wilfried</span>. 
                  The restart happens when I use python to write a ps1 file (powershell) and run it using subprocess. The code for the restart running in powershell is:

                  Start-Process 'C:\Program Files\MAXON\Cinema R16\CINEMA 4D.exe'
                  

                  This works completely fine when running strait through powershell, no Cinema involved, and runs without error. As soon as I run the same code but this time through Cinema I get the error. 
                  What makes me wonder is how some of the computers won't have this problem while others will. (The setup and program versions are all the same(latest))
                  When I get the chance I will post a simple version of the script to see if any of you can figure it out.

                  Shawn, you could try setting the current (or active) directory before starting Cinema from the shell/python to make sure the Windows DLL loader is using the same paths like when starting the app from the explorer - but with these experiments you're on your own (it 's outside of the SDK scope).

                  Best regards,

                  Wilfried

                  1 Reply Last reply Reply Quote 0
                  • H Offline
                    Helper
                    last edited by

                    On 29/10/2014 at 07:10, xxxxxxxx wrote:

                    Thanks for the replies Wilfried and Spedler.

                    A force shutdown is required, when Cinema is shut down correctly (using quit or just closing Cinema) the process will hang in the task manager due to some beta plugins such as Octane and CarbonScatter.

                    Setting paths sounds like a decent place to start troubleshooting, thanks Wilfried!

                    1 Reply Last reply Reply Quote 0
                    • H Offline
                      Helper
                      last edited by

                      On 29/10/2014 at 12:00, xxxxxxxx wrote:

                      Originally posted by xxxxxxxx

                      No that doesn't matter. Each instance of Cinema starts its own qtguiagent (it 's necessary due to the single-threaded nature of QT). If the Cinema process is killed without properly ending the qtguiagent, this qtguiagent will wait for pipe input without ever getting data but it won't conflict with newer instances of Cinema or other qtguiagents (so nothing to worry about).

                      Best regards,

                      Wilfried

                      Thanks Wilfried, I always wondered about that. Good to know that it isn't causing a problem.

                      Steve

                      1 Reply Last reply Reply Quote 0
                      • H Offline
                        Helper
                        last edited by

                        On 30/10/2014 at 09:49, xxxxxxxx wrote:

                        Taking a look into file paths I discovered that the qtguiagent.exe file is in fact not the one in the QuickTime installation but rather in cinemas win32 directory:

                        C:\Program Files\MAXON\Cinema R16\resource\libs\win32

                        Here is where the QTCF.dll file should be place and everything runs as planned.

                        I have not checked to see if this effects QuickTime files in Cinema. If someone finds that it does, please report back.

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post