• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

application instantiation

 
Ben Wu
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a legacy win32 app that currently outputs data once a system event occurs. The win32 app has a feature that allows it to call an application and pass it that data using command line arguments. (ex. "java GuiApp -arg1")
I written a small GUI app that's supposed to list all those events as they occur, the problem I have is that on every event, a new application is started instead of the data being passed to the running application.
Is there any way that I can set it so that once an app is started, that any future calls to that app will default to the running one?
Thanks.
 
Peter Chase
Ranch Hand
Posts: 1970
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ben Wu:
I have a legacy win32 app that currently outputs data once a system event occurs. The win32 app has a feature that allows it to call an application and pass it that data using command line arguments. (ex. "java GuiApp -arg1")
I written a small GUI app that's supposed to list all those events as they occur, the problem I have is that on every event, a new application is started instead of the data being passed to the running application.
Is there any way that I can set it so that once an app is started, that any future calls to that app will default to the running one?

No, I don't think you can do this as simply as you hope.
However, it's not that hard to achieve the effect that you want.
You need a small program that is started by your legacy application and makes a remote call to your permanently-running GUI application, passing the system event data, then exits.
The GUI application receives these remote calls and acts upon them.
If you write both programs in Java, you could use RMI for your remote calls. This has the advantage of being really easy.
However, starting a Java program is a fairly heavyweight operation. You might prefer that your short-lived program be something really small, in a language like C++. To achieve that, you could do the remote calls via CORBA (language-independent). Or, as the data you're passing is probably really simple, you could just use TCP/IP sockets.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic