Hi all ,
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 SetChildShowWin dow(0) and CREATE_NO_WINDO W 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, $executePath, $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
0 2441 Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Richard Shea |
last post by:
Hi - I wondered if anyone had done this before and could provide some
suggestions ? I'm interested in supplying extra functionality to a
Win32 Console (cmd.exe) - full description below for those interested.
I would do this using Python.
I'm having difficulty finding anything about Console based programming
via MSDN - I just wondered if anyone had done anything like this or
alternatively knew where the part of the Win32 API which deals...
|
by: RL |
last post by:
Hi all,
I am new and am lost with Win32::Process stuff.
I want on perl script to start a process, then another perl script to
terminate the same process.
I can start a process using...
-------------------------------------------------------
use Win32::Process;
|
by: rob |
last post by:
I created some Perl scripts on Win32 platform, and now I want to support the
same for Linux.
What are the equivalents for:
1) use Win32::Process;
2) use Win32::Process::Info;
3) Win32::FormatMessage
TIA
|
by: Paolo |
last post by:
There is something I can't understand which is the following.
I have a system command which runs a commandline to unzip a file:
my $Out = system ( $rootPath."bin/bin/gunzip -dfc ".
$SourceFilePath." > ".$rootPath.$DestinationPath.".txt");
This works fine.
since I would like to make it parallel and run 4 processes at a time I
wrote this code:
|
by: smanzel |
last post by:
When I attempt to open a new project in Visual studio and I select the
Win32 Console Project icon the Win32 Console Application window pops
up. However there is nothing in the window. There is nothing for me to
click on and clicking the Finish or the Help buttons produces nothing.
Anyone have any ideas? Thanks.
| |
by: asearle |
last post by:
Hallo everyone,
After playing around with 'fork' in order to try to get a one process to monitor another, I have changed my tack and switched to Win32::Process. Indeed, it looks like this function will be able to do what I require:
A: Start a windows application
B: While that application is running regularly monitor a log file
C: If the windows application falls over or locks up, then the monitor process will kill the job and close the...
|
by: jbenezech |
last post by:
Hi All,
I have a perl script which starts a java process using Win32::Process. Here is the code to start the java proces:
Win32::Process::Create($ProcessObj,
shift(@args),
join(" ", @args),
0,
Win32::Process::NORMAL_PRIORITY_CLASS|Win32::Process::CREATE_NO_WINDOW|Win32::Process::DETACHED_PROCESS,
$installPath) or $retCode = 99;
|
by: SheetalGandhi24 |
last post by:
Hi
I need to use the System.IO namespace in the Win32 console
application. Any clues for doing the same?
Basically, I need to load the files of a particular folder in an
array. I need to do this in a VC++.NET Win32 console application. I am
very new to using VC++.
Can anyone please help?
Thanks in anticipation,
|
by: =?Utf-8?B?cm9iaW50dw==?= |
last post by:
Hi,
While debugging my application I have noticed that occasionally a message
saying "Win32 Thread xxxx exited with code 0 (0x0)" appearing in the debug
window. I investigated this some more and found that, according to the
threads window, there were four Win32 threads in my program! I had no idea
where these had come from, and was rather worried about what they were doing.
I found that the threads were only there in programs that used...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
| |
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| | |