TKHack has asked for the wisdom of the Perl Monks concerning the following question:

I've got a weird XP/PERL/WIN32/OLE interaction thing going and I desparately need some help.

Let me explain... I've got a TK app that (amongst other things) prints text and word files to PDF by OLEing Word to print the file to the PDF printer.

The initial PERL script uses Win32::Process:Create to invoke the DOS command file and then waits until the process termintates. Everything works just fine, except, once Adobe Distiller runs, only the first document printed pops up in Acrobat (my printer options are set to show the PDF rsults after every print) all subsequent files printed never appear. If I look on my Task Manager, I see several instances of "acrobat.exe" running (1 for every file I've printed) but only 1 Acrobat window with the first file - the Acrobat app isn't hung, it responds just fine, but it's only got 1 file in it.

The problem is: only the first file printed pops up in Acrobat - until the original PERL script is exitted - then all the remaining files suddenly pop up in the Acrobat window - as if they've been waiting all this time.

Does anybody have any idea what could cause this? The processes created are all exitting normally. What's the connection to the initial PERL script?

Thank you for any wisdom which may be directed my way...
Flumoxed in Phx

  • Comment on "hung" OLE app after "Process::Create"d process terminates

Replies are listed 'Best First'.
Re: "hung" OLE app after "Process::Create"d process terminates
by traveler (Parson) on Mar 07, 2005 at 00:02 UTC
    A tiny bit of code would help. For instance, when you call Create do you set $iflags? Are all docs created with the same Create? And so forth. Also, how do you wait until the processes finish?
Re: "hung" OLE app after "Process::Create"d process terminates
by TKHack (Initiate) on Mar 08, 2005 at 04:48 UTC
    I "fixed" the problem - typical Microsoft, the fix appears to have nothing to do with the original problem. The initial PERL script was being invoked by a VB program (via a Win32 PROCESS CREATE API call). well, when I shelled the PERL call instead of creating a process everything works fine.

    No idea why, but I'm glad it works...