Hi all wise monks, I have a perl/java app running under Win32. The application consists of a perl service (Win32::Daemon) and of java classes. The perl service calls every xx hours java classes to perform some action. The java call looks like this:
Win32::SetChildShowWindow(0); Win32::Process::Create($ProcessObj, $javaExe, $commandArgs, 0, Win32::Process::NORMAL_PRIORITY_CLASS|Win32::Process::CREATE_NO_WINDOW +, $installPath) or $retCode = -9;
The point of SetChildShowWindow(0) and CREATE_NO_WINDOW is to hide the console window that perl usually displays when creating new process.

This worked fine until I tried to run the same code inside a thread.

I now have a perl module JavaCall.pm with "static" subs calling the java classes. My perl service starts a thread each time it needs to call java (if the java process is not started inside a thread, the perl service does not get the shutdown event until the java process finishes). So I have something like this:

perlservice.pl:

sub Callback_Running { $runningThread = threads->new(\&startProcess, $installPath, $executePa +th, $configFile, $parser, $logger, $configref, $Context); $runningThread->detach(); } sub startProcess { JavaCall->callJavaClass(...); }

JavaCall.pm:
Win32::SetChildShowWindow(0); Win32::Process::Create($ProcessObj, $javaExe, $commandArgs, 0, Win32::Process::NORMAL_PRIORITY_CLASS|Win32::Process::CREATE_NO_WINDOW +, $installPath) or $retCode = -9;
And here is the mistery: This works perfect under my Windows XP SP2 Profesional Edition, English. But the console "cmd.exe" shows up on a Windows XP SP2 Home Edition, French. I do not know yet if this problem is specific to Home or French edition.

This app is distributed on users PC and I cannot have that window showing up. Any help greatly appreciated. Jerome


In reply to Win32 console window & threads by jbenezech

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.