home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 14 / IOPROG_14.ISO / soft / sdkjava / sdkjava.exe / SDKJava.cab / Samples / native_com / Readme.txt < prev    next >
Encoding:
Text File  |  1998-03-05  |  2.5 KB  |  81 lines

  1. ============================================================================
  2. This sample demonstrates Java->COM and COM->Java communications.
  3.  
  4. The sample is invoked from Java.  The constructor of the class we invoke 
  5. instantiates a COM-implemented object.  Three methods are then exercised.
  6.  
  7. The first two methods take and return numeric arguments.  The third method
  8. instantiates a Java-implemented object, and passes the interface pointer back
  9. to Java, caching a local copy for its own use later on.  The new java object
  10. is then used from both Java and COM transparently.  That is, the COM object
  11. treats it no differently than any other COM object, and Java treats it as a
  12. Java object.
  13.  
  14. Copyright (c) 1996-1998 Microsoft Corporation.  All rights reserved.
  15.  
  16. ----------------------------------------------------------------------------
  17. CONTENTS:
  18.  
  19.     odl\                            ** interface descriptions
  20.         NatCom.odl
  21.         jNatCom.odl
  22.  
  23.     com\                            ** COM server
  24.         natcom.cpp
  25.         natcom.def
  26.         natcom.h
  27.         makefile
  28.  
  29.     java\
  30.         _1\                     ** run this to exec sample
  31.             JMain.java
  32.             makefile
  33.  
  34.         _2\                     ** called from COM and java
  35.             JMain.java
  36.             reg.bat
  37.             makefile
  38.  
  39. ----------------------------------------------------------------------------
  40. BUILD INSTRUCTIONS:
  41. The executable files that are built from this sample are included, so you do 
  42. not need to build the sample in order to run it.  However, the following
  43. information is included if you want to build the sample yourself. 
  44.  
  45. Dependencies:
  46.   jvc.exe, cpdbase.dll, msjvc.dll, jactivex.exe, javareg.exe.
  47.   (All are included in the SDK BIN directory.
  48.    JVC.EXE must be version 1.02.3920 or later.)
  49.     
  50. To build from this subdirectory:
  51.   nmake /a
  52.     
  53.  
  54. ----------------------------------------------------------------------------
  55. RUNNING THE SAMPLE:
  56.  
  57.   Use the GO.BAT in this subdirectory.  This batch file does the following:
  58.     
  59.   1. Registers the COM server (regsvr32 com\natcom.dll)
  60.  
  61.   2. Registers the Java server (java\_2\reg.bat)
  62.  
  63.   3. Executes JVIEW java._1.JMain
  64.      (Note: Your CLASSPATH must include '.' subdirectory)
  65.  
  66.   4. Un-registers the Java server (java\_2\unreg.bat)
  67.   
  68.   5. Un-registers the COM server (regsvr32 /u com\natcom.dll)
  69.  
  70.  
  71. ----------------------------------------------------------------------------
  72. EXPECTED CONSOLE OUTPUT:
  73.  
  74. 2 * 5 = 10
  75. inc.Square(10) = 100
  76. invoked from COM: Hello World
  77. invoked from Java: Hello World
  78.  
  79.  
  80. ============================================================================
  81.