Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Problem while executing pps file from C#

Problem while executing pps file from C#

Scheduled Pinned Locked Moved C#
helpcsharp
7 Posts 4 Posters 0 Views 1 Watching
  • 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.
  • S Offline
    S Offline
    selcuks
    wrote on last edited by
    #1

    Hi, I am executing a PowerPoint slide show file (.pps) from my C# source code using:

    System.Diagnostics.Process extProcess = System.Diagnostics.Process.Start("xdsfr.pps");
    extProcess.WaitForExit();

    The problem here is my source code immediately continues to execute and does wait for PowerPoint to exit. It seems that somehow extProcess receives "Exit" event from PowerPoint (although PowerPoint is still operating.) Because when I check for "HasExited" property of extProcess while debugging I can see it as "true". Googling about the issue gave me nothing. If you guys can give me a hint, it is appreciated. Thank you for your time, Regards,

    Always keep the Murphy Rules in mind!

    G A S 4 Replies Last reply
    0
    • S selcuks

      Hi, I am executing a PowerPoint slide show file (.pps) from my C# source code using:

      System.Diagnostics.Process extProcess = System.Diagnostics.Process.Start("xdsfr.pps");
      extProcess.WaitForExit();

      The problem here is my source code immediately continues to execute and does wait for PowerPoint to exit. It seems that somehow extProcess receives "Exit" event from PowerPoint (although PowerPoint is still operating.) Because when I check for "HasExited" property of extProcess while debugging I can see it as "true". Googling about the issue gave me nothing. If you guys can give me a hint, it is appreciated. Thank you for your time, Regards,

      Always keep the Murphy Rules in mind!

      G Offline
      G Offline
      Giorgi Dalakishvili
      wrote on last edited by
      #2

      I guess that when new process is started it calls another executable file and passes xdsfr.pps as an argument to it and the process itself exits so that's why your code doesn't stop. If my assumption is correct then you can try to find out which executable is being called and call it yourself or you can try if this helps: Using WMI to monitor process creation, deletion and modification in .NET[^]

      Giorgi Dalakishvili #region signature My Articles / My Latest Article[^] / My blog[^] #endregion

      1 Reply Last reply
      0
      • S selcuks

        Hi, I am executing a PowerPoint slide show file (.pps) from my C# source code using:

        System.Diagnostics.Process extProcess = System.Diagnostics.Process.Start("xdsfr.pps");
        extProcess.WaitForExit();

        The problem here is my source code immediately continues to execute and does wait for PowerPoint to exit. It seems that somehow extProcess receives "Exit" event from PowerPoint (although PowerPoint is still operating.) Because when I check for "HasExited" property of extProcess while debugging I can see it as "true". Googling about the issue gave me nothing. If you guys can give me a hint, it is appreciated. Thank you for your time, Regards,

        Always keep the Murphy Rules in mind!

        A Offline
        A Offline
        Ashfield
        wrote on last edited by
        #3

        I suspect its because you are not really executing xdsfr.pps, under the hood you are executing POWERPNT.EXE and passing the file name to it. Try executing POWERPNT.EXE and passing the file name as a parameter.

        Bob Ashfield Consultants Ltd

        S 1 Reply Last reply
        0
        • A Ashfield

          I suspect its because you are not really executing xdsfr.pps, under the hood you are executing POWERPNT.EXE and passing the file name to it. Try executing POWERPNT.EXE and passing the file name as a parameter.

          Bob Ashfield Consultants Ltd

          S Offline
          S Offline
          selcuks
          wrote on last edited by
          #4

          Thanx for the suggestion Bob, Tried:

          extProcess = System.Diagnostics.Process.Start("POWERPNT.EXE", filename);

          and result is the same. I will go with Giorgi's suggestion and see if it helps. Thank you both guys.

          Always keep the Murphy Rules in mind!

          modified on Wednesday, October 22, 2008 6:48 AM

          T 1 Reply Last reply
          0
          • S selcuks

            Thanx for the suggestion Bob, Tried:

            extProcess = System.Diagnostics.Process.Start("POWERPNT.EXE", filename);

            and result is the same. I will go with Giorgi's suggestion and see if it helps. Thank you both guys.

            Always keep the Murphy Rules in mind!

            modified on Wednesday, October 22, 2008 6:48 AM

            T Offline
            T Offline
            Thomas Stockwell
            wrote on last edited by
            #5

            You need to use the proper command line arguments: http://pptfaq.com/FAQ00528.htm[^]

            Regards, Thomas Stockwell Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. Visit my Blog

            1 Reply Last reply
            0
            • S selcuks

              Hi, I am executing a PowerPoint slide show file (.pps) from my C# source code using:

              System.Diagnostics.Process extProcess = System.Diagnostics.Process.Start("xdsfr.pps");
              extProcess.WaitForExit();

              The problem here is my source code immediately continues to execute and does wait for PowerPoint to exit. It seems that somehow extProcess receives "Exit" event from PowerPoint (although PowerPoint is still operating.) Because when I check for "HasExited" property of extProcess while debugging I can see it as "true". Googling about the issue gave me nothing. If you guys can give me a hint, it is appreciated. Thank you for your time, Regards,

              Always keep the Murphy Rules in mind!

              S Offline
              S Offline
              selcuks
              wrote on last edited by
              #6

              Thomas, thank you for your suggestion, I have tried the command line arguments but still my code does not wait for PowerPoint to exit. Giorgi, I have modified and used the code that you have linked. But the Process that executes the pps file exits in no time, I could not catch any of the events through POWERPNT.exe when I added to ProcessWatcher. I also tried to watch my own executable but it did not fire events too. I am not sure if I did all correctly I will keep trying for while. Funny (or should I say sad for me) I am using the same method with Visio, but the code executes just as I have expected. When I call "xdsfr.vsd" (which I have exported in previous operations) my executable hangs up operation and waits until Visio exits...

              Always keep the Murphy Rules in mind!

              modified on Wednesday, October 22, 2008 10:18 AM

              1 Reply Last reply
              0
              • S selcuks

                Hi, I am executing a PowerPoint slide show file (.pps) from my C# source code using:

                System.Diagnostics.Process extProcess = System.Diagnostics.Process.Start("xdsfr.pps");
                extProcess.WaitForExit();

                The problem here is my source code immediately continues to execute and does wait for PowerPoint to exit. It seems that somehow extProcess receives "Exit" event from PowerPoint (although PowerPoint is still operating.) Because when I check for "HasExited" property of extProcess while debugging I can see it as "true". Googling about the issue gave me nothing. If you guys can give me a hint, it is appreciated. Thank you for your time, Regards,

                Always keep the Murphy Rules in mind!

                S Offline
                S Offline
                selcuks
                wrote on last edited by
                #7

                I have found the error. And it is not related to the code that I have given. For anyone who encounters the same mistake, here is my experience: Since I use the POWERPNT.EXE in my previous operations, the Process for this executable is not properly disposed thats why I can still see the POWERPNT.EXE in my TaskManager/Processes tab. (This happens before the code in above posts is executed.) Thats why when my code executes it seems that it cannot attach itself to POWERPNT.EXE. When I managed to dispose POWERPNT.EXE process before executing the code, everything worked just fine. :cool: Thanks for help guys, Regards

                Always keep the Murphy Rules in mind!

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups