home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 39 / IOPROG_39.ISO / SOFT / sdkjava40.exe / data1.cab / fg_Samples / Samples / COM / CustomMarshal / fixedpt / FixedPtMarshaler.java < prev    next >
Encoding:
Java Source  |  2000-05-04  |  1.1 KB  |  42 lines

  1. // (C) Copyright 1995 - 1999 Microsoft Corporation.  All rights reserved.
  2. //=====================================================================
  3. // Sample Java/COM Marshaling Hook Class.
  4. //
  5. // Java Type:  double
  6. // Com  Type:  struct {
  7. //                 WORD     fract;
  8. //                 short    value;
  9. //             } FIXED;
  10. //=====================================================================
  11.  
  12.  
  13. import com.ms.com.CustomLib;
  14.  
  15. public class FixedPtMarshaler {
  16.  
  17.  
  18.     // Standard hook member: indicates size of COM type.
  19.     public static int cbByValSize = 4;  //sizeof(FIXED)
  20.  
  21.  
  22.     // Standard hook member.
  23.     public static int CustomFlags = 0;
  24.  
  25.  
  26.     // Standard hook member.
  27.     public static native double toJava(int ppETYPE, int flags);
  28.  
  29.     // Standard hook member.
  30.     public static native void copyToExternal(double javaval,
  31.                                              int   ppETYPE,
  32.                                              int   flags);
  33.  
  34.  
  35.  
  36.  
  37.     static {
  38.         // Loads the C code which implements the methods of this class.
  39.         System.loadLibrary("FixedPtMarshaler");
  40.     }
  41. }
  42.