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:
Expand|Select|Wrap|Line Numbers
- Win32::SetChildShowWindow(0);
- Win32::Process::Create(
- $ProcessObj,
- $javaExe,
- $commandArgs,
- 0,
- Win32::Process::NORMAL_PRIORITY_CLASS|Win32::Process::CREATE_NO_WINDOW,
- $installPath
- ) or $retCode = -9;
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:
Expand|Select|Wrap|Line Numbers
- sub Callback_Running {
- $runningThread = threads->new(\&startProcess, $installPath, $executePath, $configFile, $parser, $logger, $configref, $Context);
- $runningThread->detach();
- }
- sub startProcess {
- JavaCall->callJavaClass(...);
- }
Expand|Select|Wrap|Line Numbers
- Win32::SetChildShowWindow(0);
- Win32::Process::Create(
- $ProcessObj,
- $javaExe,
- $commandArgs,
- 0,
- Win32::Process::NORMAL_PRIORITY_CLASS|Win32::Process::CREATE_NO_WINDOW,
- $installPath
- ) or $retCode = -9;
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