home *** CD-ROM | disk | FTP | other *** search
/ Total Network Tools 2002 / NextStepPublishing-TotalNetworkTools2002-Win95.iso / Archive / Web Server / Savant.exe / disk1 / data1.cab / Perl5 / perl5 / lib / ole.pm < prev    next >
Encoding:
Perl POD Document  |  2001-02-23  |  2.7 KB  |  135 lines

  1. package OLE::Variant;
  2.  
  3. sub new {
  4.     my( $self );
  5.     shift;
  6.     $self->{'Type'} = shift;
  7.     $self->{'Value'} = shift;
  8.     bless $self;
  9.     return $self;
  10. }
  11.  
  12.  
  13. package OLE;
  14.  
  15. # helper routines. see ntole.cpp for all the gory stuff.
  16.  
  17. sub AUTOLOAD {
  18.     my( $fReturn );
  19.     my( $self ) = shift;
  20.     $AUTOLOAD =~ s/.*:://o;
  21.     if ( main::Win32::OLEDispatch( $self, $AUTOLOAD, $fReturn, @_ ) ) {
  22.         return $fReturn;
  23.     } else {
  24.         return undef;
  25.     }
  26. }
  27.  
  28.  
  29. # Automation data types.
  30.  
  31. eval "sub VT_EMPTY {0;}";
  32. eval "sub VT_NULL {1;}";
  33. eval "sub VT_I2 {2;}";
  34. eval "sub VT_I4 {3;}";
  35. eval "sub VT_R4 {4;}";
  36. eval "sub VT_R8 {5;}";
  37. eval "sub VT_CY {6;}";
  38. eval "sub VT_DATE {7;}";
  39. eval "sub VT_BSTR {8;}";
  40. eval "sub VT_DISPATCH {9;}";
  41. eval "sub VT_ERROR {10;}";
  42. eval "sub VT_BOOL {11;}";
  43. eval "sub VT_VARIANT {12;}";
  44. eval "sub VT_UNKNOWN {13;}";
  45. eval "sub VT_I1 {16;}";
  46. eval "sub VT_UI1 {17;}";
  47. eval "sub VT_UI2 {18;}";
  48. eval "sub VT_UI4 {19;}";
  49. eval "sub VT_I8 {20;}";
  50. eval "sub VT_UI8 {21;}";
  51. eval "sub VT_INT {22;}";
  52. eval "sub VT_UINT {23;}";
  53. eval "sub VT_VOID {24;}";
  54. eval "sub VT_HRESULT {25;}";
  55. eval "sub VT_PTR {26;}";
  56. eval "sub VT_SAFEARRAY {27;}";
  57. eval "sub VT_CARRAY {28;}";
  58. eval "sub VT_USERDEFINED {29;}";
  59. eval "sub VT_LPSTR {30;}";
  60. eval "sub VT_LPWSTR {31;}";
  61. eval "sub VT_FILETIME {64;}";
  62. eval "sub VT_BLOB {65;}";
  63. eval "sub VT_STREAM {66;}";
  64. eval "sub VT_STORAGE {67;}";
  65. eval "sub VT_STREAMED_OBJECT {68;}";
  66. eval "sub VT_STORED_OBJECT {69;}";
  67. eval "sub VT_BLOB_OBJECT {70;}";
  68. eval "sub VT_CF {71;}";
  69. eval "sub VT_CLSID {72;}";
  70.  
  71.  
  72. # Current support types are
  73. #   VT_UI1,
  74. #   VT_I2,
  75. #   VT_I4,
  76. #   VT_R4,
  77. #   VT_R8,
  78. #   VT_DATE,
  79. #   VT_BSTR,
  80. #   VT_CY,
  81. #   VT_BOOL,
  82.  
  83.  
  84.  
  85. # Typelib
  86.  
  87. eval "sub TKIND_ENUM {0;}";
  88. eval "sub TKIND_RECORD {1;}";
  89. eval "sub TKIND_MODULE {2;}";
  90. eval "sub TKIND_INTERFACE {3;}";
  91. eval "sub TKIND_DISPATCH {4;}";
  92. eval "sub TKIND_COCLASS {5;}";
  93. eval "sub TKIND_ALIAS {6;}";
  94. eval "sub TKIND_UNION {7;}";
  95. eval "sub TKIND_MAX {8;}";
  96.  
  97. sub new {
  98.     my( $object );
  99.     my( $class ) = shift;
  100.     if($class eq 'OLE')
  101.     {
  102.         $class = shift;
  103.     }
  104.     if ( main::Win32::OLECreateObject( $class, $object ) ) {
  105.         return $object;
  106.     } else {
  107.         return undef;
  108.     }
  109. }
  110.  
  111. sub copy {
  112.     my( $object );
  113.     my( $class ) = shift;
  114.     if($class eq 'OLE')
  115.     {
  116.         $class = shift;
  117.     }
  118.     if ( main::Win32::OLEGetObject( $class, $object ) ) {
  119.         return $object;
  120.     } else {
  121.         return undef;
  122.     }
  123. }
  124.  
  125. sub DESTROY {
  126.     my( $self ) = shift;
  127.     main::Win32::OLEDestroyObject( $self );
  128.     return undef;
  129. }
  130.  
  131. *CreateObject = \&new;
  132. *GetObject = \©
  133.  
  134. 1;
  135.