winapi - How can I send a command to a running Java program? -


I have a Java program and I want to send commands from my Win32 application. Normally I use the WM_COPYDATA but what options do I have with Java?

There are some ways to interoperate between Java and Windows, given the power and difficulty:

  • To handle window messages, you can use the gyoune - it's one- or something similar. Of course, if you're tie your Java program in a library like Javin, then it will never run on a non-Windows machine
  • For simple conversations between Win32 and Java, to listen only on localhost The preferred socket will be my preferred choice protocol, but I like the plain text protocol for easy debugging. Keep in mind that the user can break the socket connection if the user terminates a program.
  • You can use (local) web services here, like on both sides suggested in other posts, to make sure that you use your website service / XML libraries for creating and parsing messages. Use, if you do string containment, then it is very easy.
  • You use your Windows operating system in a COM component and a Java-to-Com bridge: Yakub or J-Interop is a popular free library for this, with J-Integra inherited system A popular choice for businesses.
  • You use the functionality of your Java program in a COM component and the Sun's Java-ActiveX bridge, from my personal experience, this is a strange option: Java-ActiveX Bridge has been developed since 1.4 Due to the establishment of ActiveX, your Java component can be installed elsewhere in the Zare directory and it's rather cumbersome to debug your Java components inside ActiveX containers.
  • SeedNoot: If you are working with stars on both sides, always note that Java is handled by some different strings from the byte arrays. Especially if you are using Windows ANSI strings, be careful that the characters 81, 8D, 8F, 90, and 9D are specified as undefined in the Windows-1252 codepage, so the question marks in Java Or the exceptions will arise if your Windows string contains these elements. Therefore, if possible, use WCHR strings on the Windows side or restrict yourself to protected characters.


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -