To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=51767


User hro changed the following:

                  What    |Old value                 |New value
================================================================================
            Ever confirmed|                          |1
--------------------------------------------------------------------------------
                    Status|UNCONFIRMED               |NEW
--------------------------------------------------------------------------------
                Issue type|DEFECT                    |ENHANCEMENT
--------------------------------------------------------------------------------
                  Priority|P3                        |P4
--------------------------------------------------------------------------------




------- Additional comments from [EMAIL PROTECTED] Fri Oct  7 02:33:39 -0700 
2005 -------
It's not up to me to blame you :-) but I feel you misunderstood some details.

What you call "Microsoft Windows" to open the document is not exactly how it 
works.

I guess you retrieve the command line assosiated with an extension from the 
registry and pass that string along with the document file name to your 
function 
WinExecAndWait32.

For example for .doc and installed MS Office that would be

"C:\Program Files\Microsoft Office\OFFICE11\WINWORD.EXE" /n /dde 
filename.doc

Doing that you're right. The /dde parameter forces additional winword.exe 
processes to stay alive as long as the window is open, so you will have 
multiple 
winword.exe processes when opening multiple documents. This happens only 
when openeing .doc files by the desktop shell or the way you did.

For other extensions like .txt a seperate process is created for every document 
because notepad.exe does not consume many system resources.

But for .pdf and Acrobat 7 there no seperate process for every document openend 
that way.

OOo does not create a seperate process for every openend document even when 
it's done by the shell. Every new created process passes it's parameters to the 
already running process and terminates afterwards. This is by design.

BTW: What I guess you are doing (retrieving the commandline from the registry, 
merging the document file name and pass that to a CreateProcess call) can 
easier 
be done by a call to the Windows API call ShellExecuteEx. You can pass the 
document file name without retrieving the assosiated command line and you'll 
get a 
process handle back for synchronization.

But coming back to what you want OOo to act like. It is not mandatory for an 
application to create a new process for every single openend document. Many 
applications do so and other don't, so this is not a defect of OOo. Also OOo 
does 
not handle the WaitForSingleObject call, it's the OS that waits for a process 
to 
terminate and the new OOo process just terminates, that's all.

Try the following: Open to .doc files with MS Word by double clicking them in 
the 
desktop shell or using your application. You'll see to winword.exe processes in 
the 
taskmanager. Now select "file Open" in the second document window and open a 
third document by the file open dialog. Now you have three open document 
windows but only two processes. Now close the two document windows openend 
by double clicking. You'll see that the last winword.exe process will stay 
alive. So 
what is that behaviour good for ?

Answer:
There are some circumstance when the behaviour of a process instance for every 
document is desired. F.e. many mail clients like Mozilla, Outlook Express, will 
start assosiated external applications when double clicking on email 
attachments. 
They create a temoprary file, pass the filename to the assosiated application, 
sync 
for procesess to terminate and delete the temporary file afterwards. They need 
to 
do so because they must now how long they have to provide the temporary file. 
If 
they would delete it before waiting for the started process to terminate the 
process 
won't be able to open file because it was deleted to fast. And if the mail 
client 
would not delete the temporary file they will rest in the file system after 
they are no 
longer used.

I don't know if the intention of your application is identical to what a common 
mail 
client does. But OOo is aware of that problematic but it handles it in a 
different 
way:
Every additional started OOo process makes sure that the document was loaded 
(in memory, or temporary file) in the "main" process before it terminates.

Please describe exactly if that behaviour meets your requirements or what your 
intention is when waiting for the process to terminate.

Changed issue type and priority



---------------------------------------------------------------------
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