Changeset 200


Ignore:
Timestamp:
Apr 2, 2007, 11:55:39 PM (18 years ago)
Author:
イグトランス (egtra)
Message:

Currencyにメンバを追加

Location:
Include
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • Include/OAIdl.ab

    r192 r200  
    13261326TypeDef LPTYPEINFO = /* [unique] */ *ITypeInfo
    13271327
    1328 Dim IID_ITypeInfo = [&H00020401, &h0000, &h0000, [&hC0, &h00, &h00, &h00, &h00, &h00, &h00, &h46]] As IID
     1328Dim IID_ITypeInfo = [&h00020401, &h0000, &h0000, [&hC0, &h00, &h00, &h00, &h00, &h00, &h00, &h46]] As IID
    13291329
    13301330Interface ITypeInfo
     
    14291429TypeDef LPTYPEINFO2 = /* [unique] */ *ITypeInfo2
    14301430
    1431 Dim IID_ITypeInfo2 = [&H00020412, &h0000, &h0000, [&hC0, &h00, &h00, &h00, &h00, &h00, &h00, &h46]] As IID
     1431Dim IID_ITypeInfo2 = [&h00020412, &h0000, &h0000, [&hC0, &h00, &h00, &h00, &h00, &h00, &h00, &h46]] As IID
    14321432
    14331433Interface ITypeInfo2
     
    14901490#endif  /* __ITypeInfo2_INTERFACE_DEFINED__ */
    14911491
    1492 #ifdef __UNDECLARED__
    1493 
    14941492#ifndef __ITypeLib_INTERFACE_DEFINED__
    14951493#define __ITypeLib_INTERFACE_DEFINED__
     
    14991497
    15001498/* [v1_enum] */
    1501 Enum SYSKIND
     1499Const Enum SYSKIND
    15021500    SYS_WIN16 = 0
    1503     SYS_WIN32 = SYS_WIN16 + 1
    1504     SYS_MAC = SYS_WIN32 + 1
    1505     SYS_WIN64 = SYS_MAC + 1
     1501    SYS_WIN32 = 1
     1502    SYS_MAC = 2
     1503    SYS_WIN64 = 3
    15061504End Enum
    15071505
    15081506/* [v1_enum] */
    1509 Enum LIBFLAGS
     1507Const Enum LIBFLAGS
    15101508    LIBFLAG_FRESTRICTED = &h1
    15111509    LIBFLAG_FCONTROL = &h2
     
    15141512End Enum
    15151513
    1516 TypeDef /* [unique] */ ITypeLib *LPTYPELIB;
     1514TypeDef LPTYPELIB = /* [unique] */ *ITypeLib
    15171515
    15181516Type TLIBATTR
     
    15251523End Type
    15261524
    1527 TypeDef struct tagTLIBATTR *LPTLIBATTR;
    1528 
    1529 
    1530 EXTERN_C const IID IID_ITypeLib;
    1531 
    1532     MIDL_INTERFACE("00020402-0000-0000-C000-000000000046")
    1533     ITypeLib : public IUnknown
    1534     {
    1535     public:
    1536         virtual /* [local] */ UINT STDMETHODCALLTYPE GetTypeInfoCount( void) As HRESULT
    1537 
    1538         Function GetTypeInfo(
    1539             /* [in] */ UINT index,
    1540             /* [out] */ ITypeInfo **ppTInfo) As HRESULT
    1541 
    1542         Function GetTypeInfoType(
    1543             /* [in] */ UINT index,
    1544             /* [out] */ TYPEKIND *pTKind) As HRESULT
    1545 
    1546         Function GetTypeInfoOfGuid(
    1547             /* [in] */ REFGUID guid,
    1548             /* [out] */ ITypeInfo **ppTinfo) As HRESULT
    1549 
    1550         virtual /* [local] */ HRESULT STDMETHODCALLTYPE GetLibAttr(
    1551             /* [out] */ TLIBATTR **ppTLibAttr) As HRESULT
    1552 
    1553         Function GetTypeComp(
    1554             /* [out] */ ITypeComp **ppTComp) As HRESULT
    1555 
    1556         virtual /* [local] */ HRESULT STDMETHODCALLTYPE GetDocumentation(
    1557             /* [in] */ INT index,
    1558             /* [out] */ BSTR *pBstrName,
    1559             /* [out] */ BSTR *pBstrDocString,
    1560             /* [out] */ DWORD *pdwHelpContext,
    1561             /* [out] */ BSTR *pBstrHelpFile) As HRESULT
    1562 
    1563         virtual /* [local] */ HRESULT STDMETHODCALLTYPE IsName(
    1564             /* [out][in] */ LPOLESTR szNameBuf,
    1565             /* [in] */ ULONG lHashVal,
    1566             /* [out] */ BOOL *pfName) As HRESULT
    1567 
    1568         virtual /* [local] */ HRESULT STDMETHODCALLTYPE FindName(
    1569             /* [out][in] */ LPOLESTR szNameBuf,
    1570             /* [in] */ ULONG lHashVal,
    1571             /* [length_is][size_is][out] */ ITypeInfo **ppTInfo,
    1572             /* [length_is][size_is][out] */ MEMBERID *rgMemId,
    1573             /* [out][in] */ USHORT *pcFound) As HRESULT
    1574 
    1575         virtual /* [local] */ void STDMETHODCALLTYPE ReleaseTLibAttr(
    1576             /* [in] */ TLIBATTR *pTLibAttr) As HRESULT
    1577 
    1578     };
     1525TypeDef LPTLIBATTR = TLIBATTR
     1526
     1527Dim ITypeLib = [&h00020402, &h0000, &h0000, [&hC0, &h00, &h00, &h00, &h00, &h00, &h00, &h46]] As IID
     1528
     1529Interface ITypeLib
     1530    Inherits IUnknown
     1531
     1532    Function /* [local] */ GetTypeInfoCount() As DWord
     1533    Function GetTypeInfo(
     1534        /* [in] */ index As DWord,
     1535        /* [out] */ ByRef pTInfo As *ITypeInfo) As HRESULT
     1536    Function GetTypeInfoType(
     1537        /* [in] */ index As DWord,
     1538        /* [out] */ ByRef TKind As TYPEKIND) As HRESULT
     1539    Function GetTypeInfoOfGuid(
     1540        /* [in] */ ByRef guid As GUID,
     1541        /* [out] */ ByRef pTInfo As *ITypeInfo) As HRESULT
     1542    Function /* [local] */ GetLibAttr(
     1543        /* [out] */ ByRef pTLibAttr As *TLIBATTR) As HRESULT
     1544    Function GetTypeComp(
     1545        /* [out] */ ByRef ppTComp As *ITypeComp) As HRESULT
     1546    Function /* [local] */ GetDocumentation(
     1547        /* [in] */ index As Long,
     1548        /* [out] */ ByRef BstrName As BSTR,
     1549        /* [out] */ ByRef BstrDocString As BSTR,
     1550        /* [out] */ ByRef dwHelpContext As DWord,
     1551        /* [out] */ ByRef BstrHelpFile As BSTR) As HRESULT
     1552    Function /* [local] */ IsName(
     1553        /* [out][in] */ szNameBuf As LPOLESTR,
     1554        /* [in] */ lHashVal As DWord,
     1555        /* [out] */ ByRef pfName As BOOL) As HRESULT
     1556    Function /* [local] */ FindName(
     1557        /* [out][in] */ szNameBuf As LPOLESTR,
     1558        /* [in] */ lHashVal As DWord,
     1559        /* [length_is][size_is][out] */ ppTInfo As **ITypeInfo,
     1560        /* [length_is][size_is][out] */ rgMemId As *MEMBERID,
     1561        /* [out][in] */ ByRef cFound As Word) As HRESULT
     1562    Sub /* [local] */ ReleaseTLibAttr(
     1563        /* [in] */ ByRef TLibAttr As TLIBATTR)
     1564End Interface
    15791565
    15801566#endif  /* __ITypeLib_INTERFACE_DEFINED__ */
    15811567
     1568
     1569#ifdef __UNDECLARED__
    15821570
    15831571#ifndef __ITypeLib2_INTERFACE_DEFINED__
  • Include/OleAuto.ab

    r192 r200  
    2424#include <oaidl.ab>
    2525'Dummy
    26 Interface ITypeLib
    27     Inherits IUnknown
    28 End Interface
    29 
    3026Interface IErrorInfo
    3127    Inherits IUnknown
  • Include/com/currency.ab

    r192 r200  
    11' com/currency.ab
     2
     3#require <com/variant.ab>
     4
     5#ifndef _COM_CURRENCY_AB
     6#define _COM_CURRENCY_AB
    27
    38Class Currency
    49Public
     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*/
    523    Const Function Operator +() As Currency
    624        Return New Currency(This)
     
    6886        VarCyRound(This.cy, c, Round.cy)
    6987    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
    70119Private
    71120    cy As CY
    72121End Class
     122
     123#endif '_COM_CURRENCY_AB
  • Include/com/index.ab

    r192 r200  
    33#require <com/bstring.ab>
    44#require <com/variant.ab>
    5 #require <com/vbojbect.ab>
     5#require <com/vbobject.ab>
    66#require <com/currency.ab>
  • Include/com/variant.ab

    r192 r200  
    66#require <oaidl.ab>
    77#require <oleauto.ab>
    8 #require <com/bstring.ab>
    9 #include <com/vbobject.ab>
     8#require <com/index.ab>
    109
    1110Class Variant
     
    111110    End Sub
    112111
     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
    113118    Sub ~Variant()
    114119        Clear()
     
    504509    End Sub
    505510
    506     'ValCy
    507 
     511    Const Function ValCy() As Currency
     512    End Function
     513
     514    Sub ValCy(x As Currency)
     515    End Sub
     516   
    508517    'ValDate
    509518
     
    557566    End Function
    558567
     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
    559576Private
    560577    v As VARIANT
     
    570587    End Sub
    571588End Class
     589
     590Dim _System_VariantOptionalParam = Nothing As Variant
     591
    572592/*
    573593Function Abs(v As Variant) As Variant
  • Include/com/vbobject.ab

    r192 r200  
    3434        pdisp = obj.pdisp
    3535        pdisp->AddRef()
    36     End Sub
    37 
    38     Sub Operator =(ByRef obj As VBObject)
    39         ~VBObject()
    40         VBObject(obj)
    4136    End Sub
    4237
     
    206201    End Function
    207202
    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*/
    218251Private
    219252    Sub setProp(ByRef arg As VARIANT, callType As Word)
Note: See TracChangeset for help on using the changeset viewer.