Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » using CTRL-C event in eclipse
using CTRL-C event in eclipse [message #188274] Mon, 02 February 2004 14:52 Go to next message
Jiang Yunhong is currently offline Jiang YunhongFriend
Messages: 1
Registered: July 2009
Junior Member
I am trying test a java program in eclipse for windows. the function of
the program is:

Using JNI. In the native method, I creat a child-process,which is a
console program, and redirect the child's input and output to a pipe, so
that the native method can read and write to the child process through the
pipe.

Then the native send a CTRL-C (with GenerateConsoleCtrlEvent) to the
child process, which has set its own CTRL-C handler.

result:

I can't send the CTRL-C event to the child process when I try to run this
program in Eclipse, the error code of GenerateConsoleCtrlEvent , which
means "invalid handle".

However, I can run this program perfect in command line with "java
XXX",where XXX is the class name created by Eclipse.

If I add a AllocConsole() call in the native method, it can still works
quite well in Eclipse, but have a new console window created, which is
what I am trying to avoid .

I think it is because 1 the Eclipse will start the javaw as the VM, which
has no console connected,while the GenerateConsoleCtrlEvent need the
calling process and called process has the same console .Has anyone has
the same experience as me?

I am not still sure what will happen if I use this native functin for
plug-in developement.
Re: using CTRL-C event in eclipse [message #188389 is a reply to message #188274] Mon, 02 February 2004 17:47 Go to previous message
Eclipse UserFriend
Originally posted by: info.oti.com

Yunhong Jiang wrote:
> I think it is because 1 the Eclipse will start the javaw as the VM, which
> has no console connected,while the GenerateConsoleCtrlEvent need the
> calling process and called process has the same console .Has anyone has
> the same experience as me?

I can't tell if your problem really is java vs javaw, but it's easy to
test. You can start Eclipse using the -vm argument to specify java
instead of javaw. The simplest way to run java instead of javaw just for
a test is to rename javaw to java_windows or something, and then copy
the java executable to javaw.

Andrew Jr.

============================================================ ==========
IBM Phoenix Labs (OTI)
11811 North Tatum Boulevard, Suite 2400
Phoenix, Arizona, USA 85028-1614
Previous Topic:Removing an item from a Tree widget
Next Topic:running a plugin in the main workspace as opposed to a run-time workspace
Goto Forum:
  


Current Time: Sat Jun 19 07:34:58 GMT 2021

Powered by FUDForum. Page generated in 0.08957 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top