To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=51767
                  Issue #:|51767
                  Summary:|After CreateProcess API call WaitforSingleObject
                          |don't work well.
                Component:|api
                  Version:|OOo 1.1.4
                 Platform:|PC
                      URL:|
               OS/Version:|Windows 2000
                   Status:|UNCONFIRMED
        Status whiteboard:|
                 Keywords:|
               Resolution:|
               Issue type:|DEFECT
                 Priority:|P1
             Subcomponent:|code
              Assigned to:|sw
              Reported by:|ccill





------- Additional comments from [EMAIL PROTECTED] Sat Jul  9 15:55:23 -0700 
2005 -------
>From Delphi 7 Language, I use the next well know routine for call external
programs an wait for terminate it. 

function WinExecAndWait32(FileName: string; Visibility: Integer): dWord;
var
  zAppName: array[0..512] of Char;
  zCurDir: array[0..255] of Char;
  WorkDir: string;
  StartupInfo: TStartupInfo;
  ProcessInfo: TProcessInformation;
begin
  StrPCopy(zAppName, FileName);
  GetDir(0, WorkDir);
  StrPCopy(zCurDir, WorkDir);
  FillChar(StartupInfo, Sizeof(StartupInfo), #0);
  StartupInfo.cb := Sizeof(StartupInfo);

  StartupInfo.dwFlags := STARTF_USESHOWWINDOW;
  StartupInfo.wShowWindow := Visibility;
  if not CreateProcess(nil,
           zAppName, { pointer to command line string }
           nil, { pointer to process security attributes }
           nil, { pointer to thread security attributes }
           false, { handle inheritance flag }
           CREATE_NEW_CONSOLE or { creation flags }
           NORMAL_PRIORITY_CLASS,
           nil, { pointer to new environment block }
           nil, { pointer to current directory name }
           StartupInfo, { pointer to STARTUPINFO }
           ProcessInfo) then
    Result := -1 { pointer to PROCESS_INF }
  else
  begin
    WaitforSingleObject(ProcessInfo.hProcess, INFINITE);
    GetExitCodeProcess(ProcessInfo.hProcess, Result);
    CloseHandle(ProcessInfo.hProcess);
    CloseHandle(ProcessInfo.hThread);
  end;
end;

    With any one application it works well. In a debug session I can see that
the step by step execution stops in WaitforSingleObject instruction and continue
when I close the external program.

   The problem is that with OpenOffice, executable starts well but they ignore
the WaitforSingleObject an continue, OpenOffice are open and my application
continues. They don't wait for OpenOffice execution end. :( 


    I tested a lot of programs and I see that only OpenOffice fails. 

   I need it for integration projects.

Thank you very much.

---------------------------------------------------------------------
Please do not reply to this automatically generated notification from
Issue Tracker. Please log onto the website and enter your comments.
http://qa.openoffice.org/issue_handling/project_issues.html#notification

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to