home *** CD-ROM | disk | FTP | other *** search
/ Chip Special: HTML & Java / Chip-Special_1997-01_HTML-a-Java.bin / javasdk / sdk-java.exe / SDKJava.cab / Samples / native_com / readme < prev   
Encoding:
Text File  |  1996-10-10  |  1.6 KB  |  57 lines

  1.  
  2. This sample demonstrates Java -> COM and COM -> Java communications.
  3.  
  4. We invoke this sample from Java.  The constructor of the class we invoke 
  5. instantiates a COM-implemented object.  3 methods are then exercised.  The 
  6. first 2 take and return numeric arguments.  The 3rd method in our COM object 
  7. instantiates a Java-implemented object, and passes the interface pointer back 
  8. up to Java, caching a local copy for its use later on.  The new java object is 
  9. then used from both Java and COM, transparently i.e. the COM object treats it 
  10. no differently than another COM object, and Java treats it as a Java object.
  11.  
  12. CONTENTS -----------------------------------------------------------------------
  13.  
  14.     odl\                ** interface descriptions
  15.         NatCom.odl
  16.         jNatCom.odl
  17.  
  18.     com\                ** COM server
  19.         natcom.cpp
  20.         natcom.def
  21.         natcom.h
  22.         makefile
  23.  
  24.     java\
  25.         _1\            ** run this to exec sample
  26.             JMain.java
  27.             makefile
  28.  
  29.         _2\            ** called from COM and java
  30.             JMain.java
  31.             reg.bat
  32.             makefile
  33.  
  34. BUILD INSTRUCTIONS -------------------------------------------------------------
  35.  
  36.     dependencies: jvc.exe, javatlb.exe, cpdbase.dll (all in the SDK BIN
  37.     directory)
  38.     
  39.     From this subdirectory: nmake /a
  40.     
  41.     To register everything:
  42.  
  43.         cd com
  44.         regsvr32 natcom.dll
  45.         cd ..\java\_2
  46.         reg
  47.         cd ..\..
  48.  
  49. RUNNING THE SAMPLE -------------------------------------------------------------
  50.  
  51.     1. make sure COM server has been registered (via regsvr32 natcom.dll)
  52.  
  53.     2. make sure that java._2.JMain has been registered (run java\_2\reg.bat)
  54.  
  55.     3. to run: JVIEW java._1.JMain
  56.         ** assuming CLASSPATH env variable searches '.' subdirectory
  57.