Changeset 200 for Include/com
- Timestamp:
- Apr 2, 2007, 11:55:39 PM (18 years ago)
- Location:
- Include/com
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
Include/com/currency.ab
r192 r200 1 1 ' com/currency.ab 2 3 #require <com/variant.ab> 4 5 #ifndef _COM_CURRENCY_AB 6 #define _COM_CURRENCY_AB 2 7 3 8 Class Currency 4 9 Public 10 /* 11 Sub Currency(x As CY) 12 cy = x 13 End Sub 14 */ 15 Sub Currency(x As Double) 16 VarCyFromR8(x, cy) 17 End Sub 18 /* 19 Sub Currency(x As Int64) 20 VarCyFromI8(x, cy) 21 End Sub 22 */ 5 23 Const Function Operator +() As Currency 6 24 Return New Currency(This) … … 68 86 VarCyRound(This.cy, c, Round.cy) 69 87 End Function 88 89 Const Function Cy() As CY 90 Return cy 91 End Function 92 93 Sub Cy(c As CY) 94 cy = c 95 End Sub 96 97 Const Function ToDouble() As Double 98 VarR8FromCy(cy, ToDouble) 99 End Function 100 101 Const Function ToInt64() As Int64 102 VarI8FromCy(cy, ToInt64) 103 End Function 104 105 Const Function ToVariant() As Variant 106 Return New Variant(This) 107 End Function 108 109 Override Function ToString() As String 110 Dim bs As BSTR 111 VarBstrFromCy(cy, LOCALE_USER_DEFAULT, LOCALE_USE_NLS, bs) 112 ToString = New String(bs As PCWSTR, SysStringLen(bs) As Long) 113 SysFreeString(bs) 114 End Function 115 116 Override Function GetHashCode() As Long 117 Return HIDWORD(cy) Xor LODWORD(cy) 118 End Function 70 119 Private 71 120 cy As CY 72 121 End Class 122 123 #endif '_COM_CURRENCY_AB -
Include/com/index.ab
r192 r200 3 3 #require <com/bstring.ab> 4 4 #require <com/variant.ab> 5 #require <com/vbo jbect.ab>5 #require <com/vbobject.ab> 6 6 #require <com/currency.ab> -
Include/com/variant.ab
r192 r200 6 6 #require <oaidl.ab> 7 7 #require <oleauto.ab> 8 #require <com/bstring.ab> 9 #include <com/vbobject.ab> 8 #require <com/index.ab> 10 9 11 10 Class Variant … … 111 110 End Sub 112 111 112 Sub Variant(n As Currency) 113 v.vt = VT_CY 114 SetQWord(VarPtr(v.val), n.Cy As QWord) 115 End Sub 116 117 113 118 Sub ~Variant() 114 119 Clear() … … 504 509 End Sub 505 510 506 'ValCy 507 511 Const Function ValCy() As Currency 512 End Function 513 514 Sub ValCy(x As Currency) 515 End Sub 516 508 517 'ValDate 509 518 … … 557 566 End Function 558 567 568 Static Function OptionalParam() As Variant 569 ' If _System_VariantOptionalParam = Nothing Then 570 ' 'ToDo マルチスレッド対応 571 _System_VariantOptionalParam = New Variant 572 _System_VariantOptionalParam.ValError = DISP_E_PARAMNOTFOUND 573 ' End If 574 Return _System_VariantOptionalParam 575 End Function 559 576 Private 560 577 v As VARIANT … … 570 587 End Sub 571 588 End Class 589 590 Dim _System_VariantOptionalParam = Nothing As Variant 591 572 592 /* 573 593 Function Abs(v As Variant) As Variant -
Include/com/vbobject.ab
r192 r200 34 34 pdisp = obj.pdisp 35 35 pdisp->AddRef() 36 End Sub37 38 Sub Operator =(ByRef obj As VBObject)39 ~VBObject()40 VBObject(obj)41 36 End Sub 42 37 … … 206 201 End Function 207 202 208 Function Call(arg1 As Variant) As Variant 209 Return Call(1, arg1.PtrToVariant) 210 End Function 211 212 Function Call(ByRef arg1 As Variant, ByRef arg2 As Variant) As Variant 213 Dim arg[1] As VARIANT 214 215 Return Call(2, VarPtr(arg1) As *VARIANT) 216 End Function 217 203 Function Call(arg0 As Variant) As Variant 204 Return Call(1, arg0.PtrToVariant) 205 End Function 206 207 Function Call(arg0 As Variant, arg1 As Variant) As Variant 208 Dim arg[ELM(2)] As VARIANT 209 arg[0] = arg0.Copy() 210 arg[1] = arg1.Copy() 211 Return Call(2, arg) 212 End Function 213 214 Function Call(arg0 As Variant, arg1 As Variant, arg2 As Variant) As Variant 215 Dim arg[ELM(3)] As VARIANT 216 arg[0] = arg0.Copy() 217 arg[1] = arg1.Copy() 218 arg[2] = arg2.Copy() 219 Return Call(3, arg) 220 End Function 221 222 Function Call(arg0 As Variant, arg1 As Variant, arg2 As Variant, arg3 As Variant) As Variant 223 Dim arg[ELM(4)] As VARIANT 224 arg[0] = arg0.Copy() 225 arg[1] = arg1.Copy() 226 arg[2] = arg2.Copy() 227 arg[3] = arg3.Copy() 228 Return Call(4, arg) 229 End Function 230 231 /* 232 Function Call(arg0 = Variant.OptionalParam As Variant, arg1 = Variant.OptionalParam As Variant, 233 arg2 = Variant.OptionalParam As Variant, arg3 = Variant.OptionalParam As Variant, 234 arg4 = Variant.OptionalParam As Variant, arg5 = Variant.OptionalParam As Variant, 235 arg6 = Variant.OptionalParam As Variant, arg7 = Variant.OptionalParam As Variant, 236 arg8 = Variant.OptionalParam As Variant, arg9 = Variant.OptionalParam As Variant) As Variant 237 Dim arg[ELM(10)] As VARIANT 238 arg[0] = arg0.Copy() 239 arg[1] = arg1.Copy() 240 arg[2] = arg2.Copy() 241 arg[3] = arg3.Copy() 242 arg[4] = arg3.Copy() 243 arg[5] = arg4.Copy() 244 arg[6] = arg5.Copy() 245 arg[7] = arg6.Copy() 246 arg[8] = arg7.Copy() 247 arg[9] = arg8.Copy() 248 Return Call(10, arg) 249 End Function 250 */ 218 251 Private 219 252 Sub setProp(ByRef arg As VARIANT, callType As Word)
Note:
See TracChangeset
for help on using the changeset viewer.