Process Hanging

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Samantha

    Process Hanging

    Hello ,

    I am developping a program for Win98 plateform, and I am stucking with a
    problem, hope you can help me.

    I have a program running 2 process :
    - One process running the Xcopy.exe
    - When the first process is finished, it runs another Exe process (HHC.exe)

    The code is below:

    // Process 1: Xcopy.exe to copy directory 1 to 2

    compiler.StartI nfo.FileName = "Xcopy.exe" ;
    compiler.StartI nfo.Arguments = Dir1 + Dir2 + " " + "/S /Y";
    compiler.StartI nfo.UseShellExe cute = false;
    compiler.StartI nfo.CreateNoWin dow = true;
    compiler.Start( );

    while (!compiler.HasE xited)
    {
    Application.DoE vents();
    {

    // Process 2: Recompilation the new CHM with Hhc.exe external command
    compiler.StartI nfo.FileName = Dir 2 + "\\" + "hhc.exe";
    compiler.StartI nfo.Arguments = Dir2 + "\\" + "Help.hhp";
    compiler.StartI nfo.UseShellExe cute = false;
    compiler.StartI nfo.CreateNoWin dow = true;
    compiler.Start( );

    while (!compiler.HasE xited)
    {
    Application.DoE vents();
    }


    My problem is that, when I run this program in Windows 98, the Xcopy process
    runs in the black window and it hangs, the process 2 cannot be run until I
    manually close it command window
    The same program works fine in WinXP or 2000

    Do you have a clue of what' s going on ?, how can I avoid this Xcopy black
    screen to appear in win98 ?

    thanks for your help

    S


  • Champika Nirosh

    #2
    Re: Process Hanging

    Hi Samantha,,

    Did you try yor xcopy command with all the needed parameter in win98 machine
    manually..

    becos I know win 98 has two command xcopy and *XCOPY32.EXE* may be there may
    have some link here.. so first try the command manually in ur windows box
    and see whether actaully it works..

    Regards,
    Nirosh.

    "Samantha" <Samantha@discu ssions.microsof t.com> wrote in message
    news:8577C1FC-1E26-4FB9-B19D-083CF0B95E27@mi crosoft.com...[color=blue]
    > Hello ,
    >
    > I am developping a program for Win98 plateform, and I am stucking with a
    > problem, hope you can help me.
    >
    > I have a program running 2 process :
    > - One process running the Xcopy.exe
    > - When the first process is finished, it runs another Exe process[/color]
    (HHC.exe)[color=blue]
    >
    > The code is below:
    >
    > // Process 1: Xcopy.exe to copy directory 1 to 2
    >
    > compiler.StartI nfo.FileName = "Xcopy.exe" ;
    > compiler.StartI nfo.Arguments = Dir1 + Dir2 + " " + "/S /Y";
    > compiler.StartI nfo.UseShellExe cute = false;
    > compiler.StartI nfo.CreateNoWin dow = true;
    > compiler.Start( );
    >
    > while (!compiler.HasE xited)
    > {
    > Application.DoE vents();
    > {
    >
    > // Process 2: Recompilation the new CHM with Hhc.exe external command
    > compiler.StartI nfo.FileName = Dir 2 + "\\" + "hhc.exe";
    > compiler.StartI nfo.Arguments = Dir2 + "\\" + "Help.hhp";
    > compiler.StartI nfo.UseShellExe cute = false;
    > compiler.StartI nfo.CreateNoWin dow = true;
    > compiler.Start( );
    >
    > while (!compiler.HasE xited)
    > {
    > Application.DoE vents();
    > }
    >
    >
    > My problem is that, when I run this program in Windows 98, the Xcopy[/color]
    process[color=blue]
    > runs in the black window and it hangs, the process 2 cannot be run until I
    > manually close it command window
    > The same program works fine in WinXP or 2000
    >
    > Do you have a clue of what' s going on ?, how can I avoid this Xcopy black
    > screen to appear in win98 ?
    >
    > thanks for your help
    >
    > S
    >
    >[/color]


    Comment

    • Champika Nirosh

      #3
      Re: Process Hanging

      second... in between these argumanet Dir1 and Dir2 I don't see a space how
      this really work in XP and 2000..

      I think you are missing some thing here..

      Nirosh.

      "Samantha" <Samantha@discu ssions.microsof t.com> wrote in message
      news:8577C1FC-1E26-4FB9-B19D-083CF0B95E27@mi crosoft.com...[color=blue]
      > Hello ,
      >
      > I am developping a program for Win98 plateform, and I am stucking with a
      > problem, hope you can help me.
      >
      > I have a program running 2 process :
      > - One process running the Xcopy.exe
      > - When the first process is finished, it runs another Exe process[/color]
      (HHC.exe)[color=blue]
      >
      > The code is below:
      >
      > // Process 1: Xcopy.exe to copy directory 1 to 2
      >
      > compiler.StartI nfo.FileName = "Xcopy.exe" ;
      > compiler.StartI nfo.Arguments = Dir1 + Dir2 + " " + "/S /Y";
      > compiler.StartI nfo.UseShellExe cute = false;
      > compiler.StartI nfo.CreateNoWin dow = true;
      > compiler.Start( );
      >
      > while (!compiler.HasE xited)
      > {
      > Application.DoE vents();
      > {
      >
      > // Process 2: Recompilation the new CHM with Hhc.exe external command
      > compiler.StartI nfo.FileName = Dir 2 + "\\" + "hhc.exe";
      > compiler.StartI nfo.Arguments = Dir2 + "\\" + "Help.hhp";
      > compiler.StartI nfo.UseShellExe cute = false;
      > compiler.StartI nfo.CreateNoWin dow = true;
      > compiler.Start( );
      >
      > while (!compiler.HasE xited)
      > {
      > Application.DoE vents();
      > }
      >
      >
      > My problem is that, when I run this program in Windows 98, the Xcopy[/color]
      process[color=blue]
      > runs in the black window and it hangs, the process 2 cannot be run until I
      > manually close it command window
      > The same program works fine in WinXP or 2000
      >
      > Do you have a clue of what' s going on ?, how can I avoid this Xcopy black
      > screen to appear in win98 ?
      >
      > thanks for your help
      >
      > S
      >
      >[/color]


      Comment

      • Samantha

        #4
        Re: Process Hanging

        Hello Nirosh,

        "> second... in between these argumanet Dir1 and Dir2 I don't see a space how[color=blue]
        > this really work in XP and 2000.."[/color]

        There is a space at the end of Dir1, I run the command manually, it works
        great. actually, when the program runs, it' s actually work because it show
        up the Xcopy windows with the files being copied and there numbers, but this
        black windows is not closing so the next process cannot be run.

        Why the Xcopy window show up and not disappear after finishing his job ?

        Regards

        S.






        "Champika Nirosh" wrote:
        [color=blue]
        > second... in between these argumanet Dir1 and Dir2 I don't see a space how
        > this really work in XP and 2000..
        >
        > I think you are missing some thing here..
        >
        > Nirosh.
        >
        > "Samantha" <Samantha@discu ssions.microsof t.com> wrote in message
        > news:8577C1FC-1E26-4FB9-B19D-083CF0B95E27@mi crosoft.com...[color=green]
        > > Hello ,
        > >
        > > I am developping a program for Win98 plateform, and I am stucking with a
        > > problem, hope you can help me.
        > >
        > > I have a program running 2 process :
        > > - One process running the Xcopy.exe
        > > - When the first process is finished, it runs another Exe process[/color]
        > (HHC.exe)[color=green]
        > >
        > > The code is below:
        > >
        > > // Process 1: Xcopy.exe to copy directory 1 to 2
        > >
        > > compiler.StartI nfo.FileName = "Xcopy.exe" ;
        > > compiler.StartI nfo.Arguments = Dir1 + Dir2 + " " + "/S /Y";
        > > compiler.StartI nfo.UseShellExe cute = false;
        > > compiler.StartI nfo.CreateNoWin dow = true;
        > > compiler.Start( );
        > >
        > > while (!compiler.HasE xited)
        > > {
        > > Application.DoE vents();
        > > {
        > >
        > > // Process 2: Recompilation the new CHM with Hhc.exe external command
        > > compiler.StartI nfo.FileName = Dir 2 + "\\" + "hhc.exe";
        > > compiler.StartI nfo.Arguments = Dir2 + "\\" + "Help.hhp";
        > > compiler.StartI nfo.UseShellExe cute = false;
        > > compiler.StartI nfo.CreateNoWin dow = true;
        > > compiler.Start( );
        > >
        > > while (!compiler.HasE xited)
        > > {
        > > Application.DoE vents();
        > > }
        > >
        > >
        > > My problem is that, when I run this program in Windows 98, the Xcopy[/color]
        > process[color=green]
        > > runs in the black window and it hangs, the process 2 cannot be run until I
        > > manually close it command window
        > > The same program works fine in WinXP or 2000
        > >
        > > Do you have a clue of what' s going on ?, how can I avoid this Xcopy black
        > > screen to appear in win98 ?
        > >
        > > thanks for your help
        > >
        > > S
        > >
        > >[/color]
        >
        >
        >[/color]

        Comment

        • Champika Nirosh

          #5
          Re: Process Hanging

          Try this...
          [color=blue][color=green][color=darkred]
          > > > compiler.StartI nfo.FileName = "Xcopy.exe" ;
          > > > compiler.StartI nfo.Arguments = Dir1 + Dir2 + " " + "/S /Y";
          > > > compiler.StartI nfo.UseShellExe cute = false;
          > > > compiler.StartI nfo.CreateNoWin dow = true;[/color][/color][/color]
          System.Diagnost ic.Process myPorc = compiler.Start( );

          When ever it is done..

          // Close process by sending a close message to its main window.
          myPorc.CloseMai nWindow();
          // Free resources associated with process.
          myPorc.Close();

          Regards,
          Nirosh.


          "Samantha" <Samantha@discu ssions.microsof t.com> wrote in message
          news:A5A4A1C8-D965-40CE-BDB6-F3C431AADA80@mi crosoft.com...[color=blue]
          > Hello Nirosh,
          >
          > "> second... in between these argumanet Dir1 and Dir2 I don't see a space[/color]
          how[color=blue][color=green]
          > > this really work in XP and 2000.."[/color]
          >
          > There is a space at the end of Dir1, I run the command manually, it works
          > great. actually, when the program runs, it' s actually work because it[/color]
          show[color=blue]
          > up the Xcopy windows with the files being copied and there numbers, but[/color]
          this[color=blue]
          > black windows is not closing so the next process cannot be run.
          >
          > Why the Xcopy window show up and not disappear after finishing his job ?
          >
          > Regards
          >
          > S.
          >
          >
          >
          >
          >
          >
          > "Champika Nirosh" wrote:
          >[color=green]
          > > second... in between these argumanet Dir1 and Dir2 I don't see a space[/color][/color]
          how[color=blue][color=green]
          > > this really work in XP and 2000..
          > >
          > > I think you are missing some thing here..
          > >
          > > Nirosh.
          > >
          > > "Samantha" <Samantha@discu ssions.microsof t.com> wrote in message
          > > news:8577C1FC-1E26-4FB9-B19D-083CF0B95E27@mi crosoft.com...[color=darkred]
          > > > Hello ,
          > > >
          > > > I am developping a program for Win98 plateform, and I am stucking with[/color][/color][/color]
          a[color=blue][color=green][color=darkred]
          > > > problem, hope you can help me.
          > > >
          > > > I have a program running 2 process :
          > > > - One process running the Xcopy.exe
          > > > - When the first process is finished, it runs another Exe process[/color]
          > > (HHC.exe)[color=darkred]
          > > >
          > > > The code is below:
          > > >
          > > > // Process 1: Xcopy.exe to copy directory 1 to 2
          > > >
          > > > compiler.StartI nfo.FileName = "Xcopy.exe" ;
          > > > compiler.StartI nfo.Arguments = Dir1 + Dir2 + " " + "/S /Y";
          > > > compiler.StartI nfo.UseShellExe cute = false;
          > > > compiler.StartI nfo.CreateNoWin dow = true;
          > > > compiler.Start( );
          > > >
          > > > while (!compiler.HasE xited)
          > > > {
          > > > Application.DoE vents();
          > > > {
          > > >
          > > > // Process 2: Recompilation the new CHM with Hhc.exe external command
          > > > compiler.StartI nfo.FileName = Dir 2 + "\\" + "hhc.exe";
          > > > compiler.StartI nfo.Arguments = Dir2 + "\\" + "Help.hhp";
          > > > compiler.StartI nfo.UseShellExe cute = false;
          > > > compiler.StartI nfo.CreateNoWin dow = true;
          > > > compiler.Start( );
          > > >
          > > > while (!compiler.HasE xited)
          > > > {
          > > > Application.DoE vents();
          > > > }
          > > >
          > > >
          > > > My problem is that, when I run this program in Windows 98, the Xcopy[/color]
          > > process[color=darkred]
          > > > runs in the black window and it hangs, the process 2 cannot be run[/color][/color][/color]
          until I[color=blue][color=green][color=darkred]
          > > > manually close it command window
          > > > The same program works fine in WinXP or 2000
          > > >
          > > > Do you have a clue of what' s going on ?, how can I avoid this Xcopy[/color][/color][/color]
          black[color=blue][color=green][color=darkred]
          > > > screen to appear in win98 ?
          > > >
          > > > thanks for your help
          > > >
          > > > S
          > > >
          > > >[/color]
          > >
          > >
          > >[/color][/color]


          Comment

          • Samantha

            #6
            Re: Process Hanging

            thanks Nirosh,

            I have tried your solution, but the compilation gives error at this line:
            [color=blue]
            > System.Diagnost ic.Process myPorc = compiler.Start( );[/color]

            error message: cannot convert type bool to System.Diagnost ic.Process.

            compiler.Start( ) return a boolean value and it cannot this value to
            System.Diagnost ic.Process....h ow can it be done ?

            regards

            S




            "Champika Nirosh" wrote:
            [color=blue]
            > Try this...
            >[color=green][color=darkred]
            > > > > compiler.StartI nfo.FileName = "Xcopy.exe" ;
            > > > > compiler.StartI nfo.Arguments = Dir1 + Dir2 + " " + "/S /Y";
            > > > > compiler.StartI nfo.UseShellExe cute = false;
            > > > > compiler.StartI nfo.CreateNoWin dow = true;[/color][/color]
            > System.Diagnost ic.Process myPorc = compiler.Start( );
            >
            > When ever it is done..
            >
            > // Close process by sending a close message to its main window.
            > myPorc.CloseMai nWindow();
            > // Free resources associated with process.
            > myPorc.Close();
            >
            > Regards,
            > Nirosh.
            >
            >
            > "Samantha" <Samantha@discu ssions.microsof t.com> wrote in message
            > news:A5A4A1C8-D965-40CE-BDB6-F3C431AADA80@mi crosoft.com...[color=green]
            > > Hello Nirosh,
            > >
            > > "> second... in between these argumanet Dir1 and Dir2 I don't see a space[/color]
            > how[color=green][color=darkred]
            > > > this really work in XP and 2000.."[/color]
            > >
            > > There is a space at the end of Dir1, I run the command manually, it works
            > > great. actually, when the program runs, it' s actually work because it[/color]
            > show[color=green]
            > > up the Xcopy windows with the files being copied and there numbers, but[/color]
            > this[color=green]
            > > black windows is not closing so the next process cannot be run.
            > >
            > > Why the Xcopy window show up and not disappear after finishing his job ?
            > >
            > > Regards
            > >
            > > S.
            > >
            > >
            > >
            > >
            > >
            > >
            > > "Champika Nirosh" wrote:
            > >[color=darkred]
            > > > second... in between these argumanet Dir1 and Dir2 I don't see a space[/color][/color]
            > how[color=green][color=darkred]
            > > > this really work in XP and 2000..
            > > >
            > > > I think you are missing some thing here..
            > > >
            > > > Nirosh.
            > > >
            > > > "Samantha" <Samantha@discu ssions.microsof t.com> wrote in message
            > > > news:8577C1FC-1E26-4FB9-B19D-083CF0B95E27@mi crosoft.com...
            > > > > Hello ,
            > > > >
            > > > > I am developping a program for Win98 plateform, and I am stucking with[/color][/color]
            > a[color=green][color=darkred]
            > > > > problem, hope you can help me.
            > > > >
            > > > > I have a program running 2 process :
            > > > > - One process running the Xcopy.exe
            > > > > - When the first process is finished, it runs another Exe process
            > > > (HHC.exe)
            > > > >
            > > > > The code is below:
            > > > >
            > > > > // Process 1: Xcopy.exe to copy directory 1 to 2
            > > > >
            > > > > compiler.StartI nfo.FileName = "Xcopy.exe" ;
            > > > > compiler.StartI nfo.Arguments = Dir1 + Dir2 + " " + "/S /Y";
            > > > > compiler.StartI nfo.UseShellExe cute = false;
            > > > > compiler.StartI nfo.CreateNoWin dow = true;
            > > > > compiler.Start( );
            > > > >
            > > > > while (!compiler.HasE xited)
            > > > > {
            > > > > Application.DoE vents();
            > > > > {
            > > > >
            > > > > // Process 2: Recompilation the new CHM with Hhc.exe external command
            > > > > compiler.StartI nfo.FileName = Dir 2 + "\\" + "hhc.exe";
            > > > > compiler.StartI nfo.Arguments = Dir2 + "\\" + "Help.hhp";
            > > > > compiler.StartI nfo.UseShellExe cute = false;
            > > > > compiler.StartI nfo.CreateNoWin dow = true;
            > > > > compiler.Start( );
            > > > >
            > > > > while (!compiler.HasE xited)
            > > > > {
            > > > > Application.DoE vents();
            > > > > }
            > > > >
            > > > >
            > > > > My problem is that, when I run this program in Windows 98, the Xcopy
            > > > process
            > > > > runs in the black window and it hangs, the process 2 cannot be run[/color][/color]
            > until I[color=green][color=darkred]
            > > > > manually close it command window
            > > > > The same program works fine in WinXP or 2000
            > > > >
            > > > > Do you have a clue of what' s going on ?, how can I avoid this Xcopy[/color][/color]
            > black[color=green][color=darkred]
            > > > > screen to appear in win98 ?
            > > > >
            > > > > thanks for your help
            > > > >
            > > > > S
            > > > >
            > > > >
            > > >
            > > >
            > > >[/color][/color]
            >
            >
            >[/color]

            Comment

            • Champika Nirosh

              #7
              Re: Process Hanging

              Hi Samantha,

              Yes you got to use some other overload to have it.. may be you can try to
              pass the startinfo object to the start method as a parameter, that will
              return the reference of the active process. Or else just try to call
              compiler.CloseM ainWindow();

              Second is try to use compiler.WaitFo rExit() Method to replace

              while (!compiler.HasE xited)
              {
              Application.DoE vents();
              }

              Note: Since this is a uncommon issue you got to try different ways to find a
              work around.. so just go to msdn and have a look at
              System.Diagnost ic.Process class and it's memebers..

              Regards,
              Nirosh.

              "Samantha" <Samantha@discu ssions.microsof t.com> wrote in message
              news:95BD3C2D-AA28-40D6-9E93-42D39F1D236B@mi crosoft.com...[color=blue]
              > thanks Nirosh,
              >
              > I have tried your solution, but the compilation gives error at this[/color]
              line:[color=blue]
              >[color=green]
              > > System.Diagnost ic.Process myPorc = compiler.Start( );[/color]
              >
              > error message: cannot convert type bool to System.Diagnost ic.Process.
              >
              > compiler.Start( ) return a boolean value and it cannot this value to
              > System.Diagnost ic.Process....h ow can it be done ?
              >
              > regards
              >
              > S
              >
              >
              >
              >
              > "Champika Nirosh" wrote:
              >[color=green]
              > > Try this...
              > >[color=darkred]
              > > > > > compiler.StartI nfo.FileName = "Xcopy.exe" ;
              > > > > > compiler.StartI nfo.Arguments = Dir1 + Dir2 + " " + "/S /Y";
              > > > > > compiler.StartI nfo.UseShellExe cute = false;
              > > > > > compiler.StartI nfo.CreateNoWin dow = true;[/color]
              > > System.Diagnost ic.Process myPorc = compiler.Start( );
              > >
              > > When ever it is done..
              > >
              > > // Close process by sending a close message to its main[/color][/color]
              window.[color=blue][color=green]
              > > myPorc.CloseMai nWindow();
              > > // Free resources associated with process.
              > > myPorc.Close();
              > >
              > > Regards,
              > > Nirosh.
              > >
              > >
              > > "Samantha" <Samantha@discu ssions.microsof t.com> wrote in message
              > > news:A5A4A1C8-D965-40CE-BDB6-F3C431AADA80@mi crosoft.com...[color=darkred]
              > > > Hello Nirosh,
              > > >
              > > > "> second... in between these argumanet Dir1 and Dir2 I don't see a[/color][/color][/color]
              space[color=blue][color=green]
              > > how[color=darkred]
              > > > > this really work in XP and 2000.."
              > > >
              > > > There is a space at the end of Dir1, I run the command manually, it[/color][/color][/color]
              works[color=blue][color=green][color=darkred]
              > > > great. actually, when the program runs, it' s actually work because[/color][/color][/color]
              it[color=blue][color=green]
              > > show[color=darkred]
              > > > up the Xcopy windows with the files being copied and there numbers,[/color][/color][/color]
              but[color=blue][color=green]
              > > this[color=darkred]
              > > > black windows is not closing so the next process cannot be run.
              > > >
              > > > Why the Xcopy window show up and not disappear after finishing his job[/color][/color][/color]
              ?[color=blue][color=green][color=darkred]
              > > >
              > > > Regards
              > > >
              > > > S.
              > > >
              > > >
              > > >
              > > >
              > > >
              > > >
              > > > "Champika Nirosh" wrote:
              > > >
              > > > > second... in between these argumanet Dir1 and Dir2 I don't see a[/color][/color][/color]
              space[color=blue][color=green]
              > > how[color=darkred]
              > > > > this really work in XP and 2000..
              > > > >
              > > > > I think you are missing some thing here..
              > > > >
              > > > > Nirosh.
              > > > >
              > > > > "Samantha" <Samantha@discu ssions.microsof t.com> wrote in message
              > > > > news:8577C1FC-1E26-4FB9-B19D-083CF0B95E27@mi crosoft.com...
              > > > > > Hello ,
              > > > > >
              > > > > > I am developping a program for Win98 plateform, and I am stucking[/color][/color][/color]
              with[color=blue][color=green]
              > > a[color=darkred]
              > > > > > problem, hope you can help me.
              > > > > >
              > > > > > I have a program running 2 process :
              > > > > > - One process running the Xcopy.exe
              > > > > > - When the first process is finished, it runs another Exe process
              > > > > (HHC.exe)
              > > > > >
              > > > > > The code is below:
              > > > > >
              > > > > > // Process 1: Xcopy.exe to copy directory 1 to 2
              > > > > >
              > > > > > compiler.StartI nfo.FileName = "Xcopy.exe" ;
              > > > > > compiler.StartI nfo.Arguments = Dir1 + Dir2 + " " + "/S /Y";
              > > > > > compiler.StartI nfo.UseShellExe cute = false;
              > > > > > compiler.StartI nfo.CreateNoWin dow = true;
              > > > > > compiler.Start( );
              > > > > >
              > > > > > while (!compiler.HasE xited)
              > > > > > {
              > > > > > Application.DoE vents();
              > > > > > {
              > > > > >
              > > > > > // Process 2: Recompilation the new CHM with Hhc.exe external[/color][/color][/color]
              command[color=blue][color=green][color=darkred]
              > > > > > compiler.StartI nfo.FileName = Dir 2 + "\\" + "hhc.exe";
              > > > > > compiler.StartI nfo.Arguments = Dir2 + "\\" + "Help.hhp";
              > > > > > compiler.StartI nfo.UseShellExe cute = false;
              > > > > > compiler.StartI nfo.CreateNoWin dow = true;
              > > > > > compiler.Start( );
              > > > > >
              > > > > > while (!compiler.HasE xited)
              > > > > > {
              > > > > > Application.DoE vents();
              > > > > > }
              > > > > >
              > > > > >
              > > > > > My problem is that, when I run this program in Windows 98, the[/color][/color][/color]
              Xcopy[color=blue][color=green][color=darkred]
              > > > > process
              > > > > > runs in the black window and it hangs, the process 2 cannot be run[/color]
              > > until I[color=darkred]
              > > > > > manually close it command window
              > > > > > The same program works fine in WinXP or 2000
              > > > > >
              > > > > > Do you have a clue of what' s going on ?, how can I avoid this[/color][/color][/color]
              Xcopy[color=blue][color=green]
              > > black[color=darkred]
              > > > > > screen to appear in win98 ?
              > > > > >
              > > > > > thanks for your help
              > > > > >
              > > > > > S
              > > > > >
              > > > > >
              > > > >
              > > > >
              > > > >[/color]
              > >
              > >
              > >[/color][/color]


              Comment

              • Champika Nirosh

                #8
                Re: Process Hanging

                Hi Samantha,

                Yes you got to use some other overload to have it.. may be you can try to
                pass the startinfo object to the start method as a parameter, that will
                return the reference of the active process. Or else just try to call
                compiler.CloseM ainWindow();

                Second is try to use compiler.WaitFo rExit() Method to replace

                while (!compiler.HasE xited)
                {
                Application.DoE vents();
                }

                Note: Since this is a uncommon issue you got to try different ways to find a
                work around.. so just go to msdn and have a look at
                System.Diagnost ic.Process class and it's memebers..

                Regards,
                Nirosh.

                "Samantha" <Samantha@discu ssions.microsof t.com> wrote in message
                news:95BD3C2D-AA28-40D6-9E93-42D39F1D236B@mi crosoft.com...[color=blue]
                > thanks Nirosh,
                >
                > I have tried your solution, but the compilation gives error at this[/color]
                line:[color=blue]
                >[color=green]
                > > System.Diagnost ic.Process myPorc = compiler.Start( );[/color]
                >
                > error message: cannot convert type bool to System.Diagnost ic.Process.
                >
                > compiler.Start( ) return a boolean value and it cannot this value to
                > System.Diagnost ic.Process....h ow can it be done ?
                >
                > regards
                >
                > S
                >
                >
                >
                >
                > "Champika Nirosh" wrote:
                >[color=green]
                > > Try this...
                > >[color=darkred]
                > > > > > compiler.StartI nfo.FileName = "Xcopy.exe" ;
                > > > > > compiler.StartI nfo.Arguments = Dir1 + Dir2 + " " + "/S /Y";
                > > > > > compiler.StartI nfo.UseShellExe cute = false;
                > > > > > compiler.StartI nfo.CreateNoWin dow = true;[/color]
                > > System.Diagnost ic.Process myPorc = compiler.Start( );
                > >
                > > When ever it is done..
                > >
                > > // Close process by sending a close message to its main[/color][/color]
                window.[color=blue][color=green]
                > > myPorc.CloseMai nWindow();
                > > // Free resources associated with process.
                > > myPorc.Close();
                > >
                > > Regards,
                > > Nirosh.
                > >
                > >
                > > "Samantha" <Samantha@discu ssions.microsof t.com> wrote in message
                > > news:A5A4A1C8-D965-40CE-BDB6-F3C431AADA80@mi crosoft.com...[color=darkred]
                > > > Hello Nirosh,
                > > >
                > > > "> second... in between these argumanet Dir1 and Dir2 I don't see a[/color][/color][/color]
                space[color=blue][color=green]
                > > how[color=darkred]
                > > > > this really work in XP and 2000.."
                > > >
                > > > There is a space at the end of Dir1, I run the command manually, it[/color][/color][/color]
                works[color=blue][color=green][color=darkred]
                > > > great. actually, when the program runs, it' s actually work because[/color][/color][/color]
                it[color=blue][color=green]
                > > show[color=darkred]
                > > > up the Xcopy windows with the files being copied and there numbers,[/color][/color][/color]
                but[color=blue][color=green]
                > > this[color=darkred]
                > > > black windows is not closing so the next process cannot be run.
                > > >
                > > > Why the Xcopy window show up and not disappear after finishing his job[/color][/color][/color]
                ?[color=blue][color=green][color=darkred]
                > > >
                > > > Regards
                > > >
                > > > S.
                > > >
                > > >
                > > >
                > > >
                > > >
                > > >
                > > > "Champika Nirosh" wrote:
                > > >
                > > > > second... in between these argumanet Dir1 and Dir2 I don't see a[/color][/color][/color]
                space[color=blue][color=green]
                > > how[color=darkred]
                > > > > this really work in XP and 2000..
                > > > >
                > > > > I think you are missing some thing here..
                > > > >
                > > > > Nirosh.
                > > > >
                > > > > "Samantha" <Samantha@discu ssions.microsof t.com> wrote in message
                > > > > news:8577C1FC-1E26-4FB9-B19D-083CF0B95E27@mi crosoft.com...
                > > > > > Hello ,
                > > > > >
                > > > > > I am developping a program for Win98 plateform, and I am stucking[/color][/color][/color]
                with[color=blue][color=green]
                > > a[color=darkred]
                > > > > > problem, hope you can help me.
                > > > > >
                > > > > > I have a program running 2 process :
                > > > > > - One process running the Xcopy.exe
                > > > > > - When the first process is finished, it runs another Exe process
                > > > > (HHC.exe)
                > > > > >
                > > > > > The code is below:
                > > > > >
                > > > > > // Process 1: Xcopy.exe to copy directory 1 to 2
                > > > > >
                > > > > > compiler.StartI nfo.FileName = "Xcopy.exe" ;
                > > > > > compiler.StartI nfo.Arguments = Dir1 + Dir2 + " " + "/S /Y";
                > > > > > compiler.StartI nfo.UseShellExe cute = false;
                > > > > > compiler.StartI nfo.CreateNoWin dow = true;
                > > > > > compiler.Start( );
                > > > > >
                > > > > > while (!compiler.HasE xited)
                > > > > > {
                > > > > > Application.DoE vents();
                > > > > > {
                > > > > >
                > > > > > // Process 2: Recompilation the new CHM with Hhc.exe external[/color][/color][/color]
                command[color=blue][color=green][color=darkred]
                > > > > > compiler.StartI nfo.FileName = Dir 2 + "\\" + "hhc.exe";
                > > > > > compiler.StartI nfo.Arguments = Dir2 + "\\" + "Help.hhp";
                > > > > > compiler.StartI nfo.UseShellExe cute = false;
                > > > > > compiler.StartI nfo.CreateNoWin dow = true;
                > > > > > compiler.Start( );
                > > > > >
                > > > > > while (!compiler.HasE xited)
                > > > > > {
                > > > > > Application.DoE vents();
                > > > > > }
                > > > > >
                > > > > >
                > > > > > My problem is that, when I run this program in Windows 98, the[/color][/color][/color]
                Xcopy[color=blue][color=green][color=darkred]
                > > > > process
                > > > > > runs in the black window and it hangs, the process 2 cannot be run[/color]
                > > until I[color=darkred]
                > > > > > manually close it command window
                > > > > > The same program works fine in WinXP or 2000
                > > > > >
                > > > > > Do you have a clue of what' s going on ?, how can I avoid this[/color][/color][/color]
                Xcopy[color=blue][color=green]
                > > black[color=darkred]
                > > > > > screen to appear in win98 ?
                > > > > >
                > > > > > thanks for your help
                > > > > >
                > > > > > S
                > > > > >
                > > > > >
                > > > >
                > > > >
                > > > >[/color]
                > >
                > >
                > >[/color][/color]


                Comment

                Working...