Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
2.4 KiB

  1. Sample: JavaDraw
  2. Purpose:
  3. This application demonstrates how to implement a distributed drawing application using Java SDK 4.0 and the MSMQ COM components.
  4. The sample also demonstrates how to handle MSMQ COM Events in Java.
  5. Requirements:
  6. 1. MSMQ 2.0 or greater (needed for running the application).
  7. 2. Java compilation environment for building the application (Microsoft Platform SDK with Java tools, or MIcrosoft Visual J++ 6.0 or greater, or Microsoft SDK for Java 4.0 or greater).
  8. 3. The latest JActiveX.exe tool included in Microsoft SDK for Java 4.0.
  9. Overview:
  10. The sample uses MSMQ to send and receive messages that store drawings using safearrays and key stroke data as strings.
  11. This program constructs and sends a single message for the entire stroke (mouse-down to mouse-up). It demonstrates an object-oriented approach in order to send and receive different data types using Java.
  12. VB and C-based versions of the distributed drawing sample in MSMQ SDK will not interoperate with this sample since they use a string-encoded format to represent lines. A compatible version of JavaDraw can be made by replacing the safe-array usage with the appropriate string encoding (see vb_draw).
  13. Note that this application is not designed to run on a DS-disabled computer.
  14. Build:
  15. You MUST use the latest JActiveX.exe tool included in Microsoft SDK for Java 4.0. If you use an older version of JActiveX.exe, you need to replace it with the new JActiveX.exe file from Microsoft SDK for Java 4.0.
  16. Run nmake to process the makfile and build the sample.
  17. SafeArrays and Variants are described in the Microsoft SDK for Java 4.0 documentation which is also available from http://www.microsoft.com/java/sdk.
  18. Using this application:
  19. 1. Run the application (use "JView.exe DistDraw.class", or DistDraw.exe if you built the application in MIcrosoft Visual J++ 6.0 using DistDraw.vjp).
  20. 2. Enter the name of a local queue and click the "Login" button. If a queue with that name does not exist
  21. a queue with the same name will be created.
  22. 3. From the File menu choose "Connect" to connect to a remote queue.
  23. 4. Enter the remote queue name you wish to connect to.
  24. 5. Run a second instance of the same application.
  25. Enter as the login name the same name you entered at step 4 and entering as the remote queue name the name you entered in step 2.
  26. 6. You now can use the mouse to draw in each application's window or send text messages between the applications.