Changeset 478


Ignore:
Timestamp:
Mar 13, 2008, 9:06:43 PM (17 years ago)
Author:
イグトランス (egtra)
Message:

現在向けに修正(参照型のポインタの排除など)

Location:
trunk/Include
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/Include/Classes/ActiveBasic/Strings/Strings.ab

    r457 r478  
    11'Classes/ActiveBasic/Strings/Strings.ab
    2 
    3 #ifndef __ACTIVEBASIC_STRINGS_STRINGS_AB__
    4 #define __ACTIVEBASIC_STRINGS_STRINGS_AB__
    5 
    6 #require <Classes/System/Math.ab>
    7 #require <Classes/System/Collections/ArrayList.ab>
    82
    93Namespace ActiveBasic
     
    220214End Namespace 'ActiveBasic
    221215
    222 #endif '__ACTIVEBASIC_STRINGS_STRINGS_AB__
  • trunk/Include/Classes/System/String.ab

    r468 r478  
    256256
    257257        Override Function Equals(s As Object) As Boolean
    258             If Object.Equals( This.GetType(), s.GetType() ) Then
    259                 Return This.Equals(s As String)
     258            If Not ActiveBasic.IsNothing(s) Then
     259                If Object.Equals(This.GetType(), s.GetType()) Then
     260                    Return This.Equals(s As String)
     261                End If
    260262            End If
    261263            Return False
  • trunk/Include/OAIdl.ab

    r303 r478  
    22' 本来はOAIdl.idlから生成するのが正当ですが、
    33' これは手動で移植したものです。
    4 
    5 #ifndef _INC_OAIDL_AB
    6 #define _INC_OAIDL_AB
    7 
    8 '#ifndef COM_NO_WINDOWS_H
    9 #require <windows.sbp>
    10 #require <ole2.ab>
    11 '#endif /*COM_NO_WINDOWS_H*/
    124
    135#require <objidl.sbp>
     
    777769
    778770Type /* [wire_marshal] */ CLEANLOCALSTORAGE
    779     pInterface As *IUnknown
     771    pInterface As IUnknown
    780772    pStorage As VoidPtr
    781773    flags As DWord
     
    823815        /* [in] */ wMinorVerNum As Word) As HRESULT
    824816    Function AddRefTypeInfo(
    825         /* [in] */ pTInfo As *ITypeInfo,
     817        /* [in] */ TInfo As ITypeInfo,
    826818        /* [in] */ByRef hRefType As HREFTYPE) As HRESULT
    827819    Function AddFuncDesc(
     
    10371029        /* [in] */ iTInfo As DWord,
    10381030        /* [in] */ lcid As LCID,
    1039         /* [out] */ ByRef pTInfo As *ITypeInfo) As HRESULT
     1031        /* [out] */ ByRef TInfo As ITypeInfo) As HRESULT
    10401032    Function GetIDsOfNames(
    10411033        /* [in] */ ByRef riid As IID,
     
    10781070    Function Reset() As HRESULT
    10791071    Function Clone(
    1080         /* [out] */ ByRef pEnum As *IEnumVARIANT) As HRESULT
     1072        /* [out] */ ByRef enum_ As IEnumVARIANT) As HRESULT
    10811073
    10821074End Interface
     
    11051097    lpfuncdesc As *FUNCDESC
    11061098    lpvardesc As *VARDESC
    1107     lptcomp As *ITypeComp
     1099    lptcomp As ITypeComp
    11081100End Union
    11091101*/
     
    11231115        /* [in] */ HashVal As DWord,
    11241116        /* [in] */ wFlags As Word,
    1125         /* [out] */ ByRef pTInfo As *ITypeInfo,
     1117        /* [out] */ ByRef TInfo As ITypeInfo,
    11261118        /* [out] */ ByRef DescKind As DESCKIND,
    11271119        /* [out] */ ByRef BindPtr As BINDPTR) As HRESULT
     
    11301122        /* [in] */ szName As LPOLESTR,
    11311123        /* [in] */ HashVal As DWord,
    1132         /* [out] */ ByRef pTInfo As *ITypeInfo,
    1133         /* [out] */ ByRef pTComp As *ITypeComp) As HRESULT
     1124        /* [out] */ ByRef TInfo As ITypeInfo,
     1125        /* [out] */ ByRef TComp As ITypeComp) As HRESULT
    11341126End Interface
    11351127
     
    13331325    Function GetTypeInfo(
    13341326        /* [in] */ index As DWord,
    1335         /* [out] */ ByRef pTInfo As *ITypeInfo) As HRESULT
     1327        /* [out] */ ByRef TInfo As ITypeInfo) As HRESULT
    13361328    Function GetTypeInfoType(
    13371329        /* [in] */ index As DWord,
     
    13391331    Function GetTypeInfoOfGuid(
    13401332        /* [in] */ ByRef guid As GUID,
    1341         /* [out] */ ByRef pTInfo As *ITypeInfo) As HRESULT
     1333        /* [out] */ ByRef TInfo As ITypeInfo) As HRESULT
    13421334    Function /* [local] */ GetLibAttr(
    1343         /* [out] */ ByRef pTLibAttr As *TLIBATTR) As HRESULT
     1335        /* [out] */ ByRef TLibAttr As TLIBATTR) As HRESULT
    13441336    Function GetTypeComp(
    1345         /* [out] */ ByRef ppTComp As *ITypeComp) As HRESULT
     1337        /* [out] */ ByRef TComp As ITypeComp) As HRESULT
    13461338    Function /* [local] */ GetDocumentation(
    13471339        /* [in] */ index As Long,
     
    13571349        /* [out][in] */ szNameBuf As LPOLESTR,
    13581350        /* [in] */ lHashVal As DWord,
    1359         /* [length_is][size_is][out] */ ppTInfo As **ITypeInfo,
     1351        /* [length_is][size_is][out] */ pTInfo As *ITypeInfo,
    13601352        /* [length_is][size_is][out] */ rgMemId As *MEMBERID,
    13611353        /* [out][in] */ ByRef cFound As Word) As HRESULT
     
    14251417    Function RequestTypeChange(
    14261418        /* [in] */ changeKind As CHANGEKIND,
    1427         /* [in] */ pTInfoBefore As ITypeInfo,
     1419        /* [in] */ TInfoBefore As ITypeInfo,
    14281420        /* [in] */ pStrName As LPOLESTR,
    14291421        /* [out] */ ByRef fCancel As Long) As HRESULT
    14301422    Function AfterTypeChange(
    14311423        /* [in] */ changeKind As CHANGEKIND,
    1432         /* [in] */ pTInfoAfter As *ITypeInfo,
     1424        /* [in] */ TInfoAfter As ITypeInfo,
    14331425        /* [in] */ pStrName As LPOLESTR) As HRESULT
    14341426End Interface
     
    15251517
    15261518    Function CreateFromTypeInfo(
    1527         /* [in] */ pTypeInfo As *ITypeInfo,
     1519        /* [in] */ TypeInfo As ITypeInfo,
    15281520        /* [in] */ ByRef riid As IID,
    1529         /* [iid_is][out] */ ByRef pv As *IUnknown) As HRESULT
     1521        /* [iid_is][out] */ ByRef pv As IUnknown) As HRESULT
    15301522End Interface
    15311523
     
    16201612        /* [length_is][size_is][out] */ rgBstrNames As *BSTR) As HRESULT
    16211613    Function IsMatchingType(
    1622         /* [in] */ pRecordInfo As *IRecordInfo) As BOOL
     1614        /* [in] */ RecordInfo As IRecordInfo) As BOOL
    16231615    Function RecordCreate() As VoidPtr
    16241616    Function RecordCreateCopy(
     
    16781670#endif  /* __IPropertyBag_INTERFACE_DEFINED__ */
    16791671
    1680 #endif '_INC_OAIDL_AB
  • trunk/Include/api_imm.sbp

    r300 r478  
    11' api_imm.sbp
    2 
    3 #ifndef _IMM_
    4 #define _IMM_
    5 
    6 #ifndef _IMM_SDK_DEFINED_
    7 #define _IMM_SDK_DEFINED_
    82
    93Type _System_DeclareHandle_HIMC:unused As DWord:End Type
     
    702696' for Windows Simplified Chinese Edition
    703697Const SOFTKEYBOARD_TYPE_C1 = &h0002
    704 
    705 #endif '_IMM_SDK_DEFINED_
    706 
    707 #endif '_IMM_
  • trunk/Include/basic/command.sbp

    r457 r478  
    44#ifndef _INC_COMMAND
    55#define _INC_COMMAND
    6 
    7 #require <windows.sbp>
    8 #require <Classes/System/Environment.ab>
    9 #require <Classes/ActiveBasic/Windows/Windows.ab>
    106
    117Const _System_Type_SByte = 1
     
    6763
    6864Macro MSGBOX(hwnd As HWND, str As String)(title As String, boxType As DWord, ByRef retAns As DWord)
    69     Dim ret = ActiveBasic.Windows.Detail._System_MessageBox(hwnd, ToSCStr(str), ToSCStr(title), boxType)
    70     If VarPtr(retAns) Then
    71         retAns = ret
    72     End If
     65'   Dim ret = MessageBox(hwnd, ToTCStr(str), ToTCStr(title), boxType)
     66'   If VarPtr(retAns) Then
     67'       retAns = ret
     68'   End If
    7369End Macro
    7470
  • trunk/Include/com/bstring.ab

    r335 r478  
    11' com/bstring.ab
    2 
    3 '#require <ole2.ab>
    4 '#require <oleauto.ab>
    52
    63Namespace ActiveBasic
     
    85
    96Class BString
    10     'Inherits System.IDisposable, System.ICloneable
     7    Implements System.IDisposable ', System.ICloneable
    118Public
    129    Sub BString()
     
    1916
    2017    Sub BString(s As BString)
    21         BString.Copy(This.bs, s.bs)
    22     End Sub
    23 
    24     Sub BString(s As LPCOLESTR)
    25         bs = SysAllocString(s)
     18        If Not IsNothing(s) Then
     19            bs = copy(s.bs)
     20        End If
    2621    End Sub
    2722
    2823    Sub BString(s As LPCOLESTR, len As DWord)
    29         bs = SysAllocStringLen(s, len)
    30     End Sub
    31 
    32     Sub BString(s As PCSTR)
    33         Init(s, lstrlenA(s))
    34     End Sub
    35 
    36     Sub BString(s As PCSTR, len As DWord)
    37         Dim lenBS = MultiByteToWideChar(CP_THREAD_ACP, 0, s, len As Long, 0, 0)
    38         bs = SysAllocStringLen(0, lenBS)
    39         MultiByteToWideChar(CP_THREAD_ACP, 0, s, len As Long, bs, lenBS)
     24        If s <> 0 Then
     25            bs = SysAllocStringLen(s, len)
     26        End If
    4027    End Sub
    4128
    4229    Sub BString(s As String)
    43         Init(s.StrPtr, s.Length As DWord)
    44     End Sub
     30        If Not IsNothing(s) Then
     31            Init(s.StrPtr, s.Length As DWord)
     32        End If
     33    End Sub
     34
     35    Static Function FromBStr(bs As BSTR) As BString
     36        FromBStr = New BString(bs, SysStringLen(bs))
     37    End Function
     38
     39    Static Function FromCStr(s As PCWSTR) As BString
     40        If s <> 0 Then
     41            FromCStr = New BString(s, lstrlenW(s))
     42        Else
     43            FromCStr = New BString
     44        End If
     45    End Function
     46
     47    Static Function FromCStr(s As PCWSTR, len As DWord) As BString
     48        If s <> 0 Then
     49            FromCStr = New BString(s, len)
     50        Else
     51            FromCStr = New BString
     52        End If
     53    End Function
     54
     55    Static Function FromCStr(s As PCSTR) As BString
     56        Dim dst As PCWSTR
     57        Dim lenW = GetStr(s, dst)
     58        FromCStr = FromCStr(s, lenW)
     59    End Function
     60
     61    Static Function FromCStr(s As PCSTR, len As DWord) As BString
     62        Dim dst As PCWSTR
     63        Dim lenW = GetStr(s, len, dst)
     64        FromCStr = FromCStr(s, lenW)
     65    End Function
    4566
    4667    Sub ~BString()
     
    4869    End Sub
    4970
    50     Sub Assign(bstr As BString)
    51         Clear()
    52         BString.Copy(This.bs, bstr.bs)
    53     End Sub
    54 
    55     Sub Assign(s As LPCOLESTR)
    56         Clear()
    57         s = SysAllocString(s)
    58     End Sub
    59 
    60     Sub AssignFromBStr(bstr As BSTR)
    61         Clear()
    62         BString.Copy(bs, bstr)
    63     End Sub
    64 
    6571    Const Function Copy() As BSTR
    66         BString.Copy(Copy, bs)
     72        Copy = copy(bs)
    6773    End Function
    6874
     
    7682
    7783    Sub Clear()
    78         If bs <> 0 Then
    79             SysFreeString(bs)
    80             bs = 0
    81         End If
     84        reset(0)
    8285    End Sub
    8386
    8487    Sub Attach(ByRef bstr As BSTR)
    85         Clear()
    86         BString.Move(bs, bstr)
     88        reset(move(bstr))
    8789    End Sub
    8890
    8991    Function Detach() As BSTR
    90         BString.Move(Detach, bs)
     92        Detach = move(bs)
    9193    End Function
    9294
    9395    Function BStr() As BSTR
    9496        BStr = bs
    95     End Function
    96 /*
    97     Static Function Assgin(bs As BSTR) As BString
    98         Assgin = New BString
    99         Assgin.Assgin(bs)
    10097    End Function
    10198
     
    104101        Attach.Attach(bs)
    105102    End Function
    106 */
     103
    107104    Const Function Length() As DWord
    108         Length = SysStringLen(bs)
     105        Length = GetDWord(bs As VoidPtr - SizeOf (DWord)) 'SysStringLen(bs)
    109106    End Function
    110107
    111108    Const Function Operator [](i As SIZE_T) As OLECHAR
    112 #ifdef _DEBUG
    113109        If i > Length Then
    114             'Throw OutOfRangeException
    115         End If
    116 #endif
     110            Throw New ArgumentOutOfRangeException("i")
     111        End If
    117112        Return bs[i]
    118113    End Function
    119114
    120115    Sub Operator []=(i As SIZE_T, c As OLECHAR)
    121 #ifdef _DEBUG
    122116        If i > Length Then
    123             'Throw OutOfRangeException
    124         End If
    125 #endif
     117            Throw New ArgumentOutOfRangeException("i")
     118        End If
    126119        bs[i] = c
    127120    End Sub
     
    135128    End Function
    136129
     130    Override Function Equals(o As Object) As Boolean
     131        If Not IsNothing(o) Then
     132            If This.GetType().Equals(o.GetType()) Then
     133                Equals(o As BString)
     134            End If
     135        End If
     136    End Function
     137
     138    Const Function Equals(s As BString) As Boolean
     139        Equals = Compare(This, s) = 0
     140    End Function
     141
     142    Static Function Compare(l As BString, r As BString) As Long
     143        If IsNullOrEmpty(l) Then
     144            If IsNullOrEmpty(r) Then
     145                Compare = 0
     146            Else
     147                Compare = -1
     148            End If
     149        Else
     150            If IsNullOrEmpty(bsr) Then
     151                Compare = 1
     152            Else
     153                Compare = Strings.ChrCmp(l.bs, l.Length As SIZE_T, r.bs, r.Length As SIZE_T)
     154            End If
     155        End If
     156    End Function
     157
     158    Static Function IsNullOrEmpty(s As BString)
     159        If IsNothing(s) Then
     160            IsNullOrEmpty = True
     161        ElseIf s.bs = 0 Then
     162            IsNullOrEmpty = True
     163        ElseIf s.Length = 0 Then
     164            IsNullOrEmpty = True
     165        Else
     166            IsNullOrEmpty = False
     167        End If
     168    End Function
     169
     170    Function Operator ==(s As BString) As Boolean
     171        Return Compare(This, s) = 0
     172    End Function
     173
     174    Function Operator <>(s As BString) As Boolean
     175        Return Compare(This, s) <> 0
     176    End Function
     177
     178    Function Operator <(s As BString) As Boolean
     179        Return Compare(This, s) < 0
     180    End Function
     181
     182    Function Operator <=(s As BString) As Boolean
     183        Return Compare(This, s) <= 0
     184    End Function
     185
     186    Function Operator >(s As BString) As Boolean
     187        Return Compare(This, s) > 0
     188    End Function
     189
     190    Function Operator >=(s As BString) As Boolean
     191        Return Compare(This, s) >= 0
     192    End Function
     193
    137194Private
    138195    bs As BSTR
    139196
    140     Sub Init(s As PCSTR, len As DWord)
    141         Dim lenBS = MultiByteToWideChar(CP_THREAD_ACP, 0, s, len As Long, 0, 0)
    142         bs = SysAllocStringLen(0, lenBS)
    143         MultiByteToWideChar(CP_THREAD_ACP, 0, s, len As Long, bs, lenBS)
    144     End Sub
    145 
    146     Static Sub Copy(ByRef dst As BSTR, ByVal src As BSTR)
    147         dst = SysAllocStringLen(src, SysStringLen(src))
    148     End Sub
    149 
    150     Static Sub Move(ByRef dst As BSTR, ByRef src As BSTR)
    151         dst = src
    152         src = 0
    153     End Sub
     197    Sub init(s As PCSTR, len As DWord)
     198        If <> 0 Then
     199            Dim lenBS = MultiByteToWideChar(CP_THREAD_ACP, 0, s, len As Long, 0, 0)
     200            bs = SysAllocStringLen(0, lenBS)
     201            If bs <> 0 Then
     202                MultiByteToWideChar(CP_THREAD_ACP, 0, s, len As Long, bs, lenBS)
     203            End If
     204        End If
     205    End Sub
     206
     207    Sub reset(newBS As BSTR)
     208        Dim old = InterlockedExchangePointer(bs, newBS)
     209        SysFreeString(old)
     210    End Sub
     211
     212    Static Function copy(src As BSTR) As BSTR
     213        copy = SysAllocStringLen(src, SysStringLen(src))
     214    End Function
     215
     216    Static Function move(ByRef src As BSTR) As BSTR
     217        move = InterlockedExchangePointer(src, 0)
     218    End Function
    154219End Class
    155220
  • trunk/Include/com/currency.ab

    r355 r478  
    22
    33#require <com/variant.ab>
    4 
    5 #ifndef _COM_CURRENCY_AB
    6 #define _COM_CURRENCY_AB
    74
    85Namespace ActiveBasic
     
    5653        Return ret
    5754    End Function
    58 /*
     55
    5956    Const Function Operator /(y As Variant) As Double
    6057        Dim vx = New Variant(This)
     
    6966        Return ret.ValR8
    7067    End Function
    71 */
     68
    7269    Const Function Operator +(y As Currency) As Currency
    7370        Dim ret = New Currency
     
    131128        Return c = VARCMP_LT
    132129    End Function
    133 /*
     130
    134131    Const Function Operator >(y As Currency) As Boolean
    135132        Dim c = Compare(This, y)
     
    141138        Return c = VARCMP_GT
    142139    End Function
    143 */
     140
    144141    Const Function Operator <=(y As Currency) As Boolean
    145142        Dim c = Compare(This, y)
     
    183180
    184181    Const Function Cy() As CY
    185         Return cy
     182        Cy = cy
    186183    End Function
    187184
     
    203200
    204201    Override Function ToString() As String
    205         Dim bs As BSTR
    206         VarBstrFromCy(cy, LOCALE_USER_DEFAULT, LOCALE_USE_NLS, bs)
    207         ToString = New String(bs As PCWSTR, SysStringLen(bs) As Long)
    208         SysFreeString(bs)
     202        /*Using*/ Dim bstr = New BString
     203            Dim bs As BSTR
     204            VarBstrFromCy(cy, LOCALE_USER_DEFAULT, LOCALE_USE_NLS, bs)
     205            bstr.Attach(bs)
     206            ToString = bstr.ToString
     207        bstr.Dispose() 'End Using
    209208    End Function
    210209
     
    223222End Namespace 'COM
    224223End Namespace 'ActiveBasic
    225 
    226 #endif '_COM_CURRENCY_AB
  • trunk/Include/com/decimal.ab

    r355 r478  
    11' com/decimal.ab
    22
    3 '#require <oleauto.ab>
    43#require <com/variant.ab>
    54#require <com/currency.ab>
     
    1413
    1514    Sub Decimal(d As Decimal)
    16 '       dec = d なぜかコンパイルできない
    17         memcpy(VarPtr(dec), VarPtr(d.dec), Len(dec))
     15        dec = d.dec
    1816    End Sub
    1917
    2018    Sub Decimal(ByRef d As DECIMAL)
    21         memcpy(VarPtr(dec), VarPtr(d), Len(dec))
     19        dec = d
    2220    End Sub
    2321
    2422    Sub Decimal(lo As Long, mid As Long, hi As Long, isNegative As Boolean, scale As Byte)
    2523        If scale > 28 Then
    26             Debug
    27             Throw New ArgumentOutOfRangeException
     24            Throw New ArgumentOutOfRangeException("scale")
    2825        End If
    2926        Dim sign As Byte
     
    284281        Return c = VARCMP_LT
    285282    End Function
    286 /*
     283
    287284    Const Function Operator >(y As Decimal) As Boolean
    288285        Dim c = Compare(This, y)
     
    294291        Return c = VARCMP_GT
    295292    End Function
    296 */
     293
    297294    Const Function Operator <=(y As Decimal) As Boolean
    298295        Dim c = Compare(This, y)
     
    348345
    349346    Override Function ToString() As String
    350         Dim bs As BSTR
    351         VarBstrFromDec(dec, LOCALE_USER_DEFAULT, LOCALE_USE_NLS, bs)
    352         ToString = New String(bs As PCWSTR, SysStringLen(bs) As Long)
    353         SysFreeString(bs)
     347        /*Using*/ Dim bstr = New BString
     348            Dim bs As BSTR
     349            VarBstrFromDec(dec, LOCALE_USER_DEFAULT, LOCALE_USE_NLS, bs)
     350            bstr.Attach(bs)
     351            ToString = bstr.ToString
     352        bstr.Dispose() 'End Using
    354353    End Function
    355354
  • trunk/Include/com/variant.ab

    r355 r478  
    11' com/variant.ab
    22
    3 #ifndef _COM_VARIANT_AB
    4 #define _COM_VARIANT_AB
    5 
    6 '#require <oaidl.ab>
    7 '#require <oleauto.ab>
    83'#require <com/index.ab>
    94
     
    7974    Sub Variant(bs As BString)
    8075        v.vt = VT_BSTR
    81         SetPointer(VarPtr(v.val), SysAllocStringLen(bs.BStr, bs.Length))
    82     End Sub
    83 
    84     Sub Variant(p As *IUnknown)
    85         p->AddRef()
     76        SetPointer(VarPtr(v.val), bs.Copy))
     77    End Sub
     78
     79    Sub Variant(unk As IUnknown)
     80        If Not IsNothing(unk) Then unk.AddRef()
    8681        v.vt = VT_UNKNOWN
    87         SetPointer(VarPtr(v.val), p)
    88     End Sub
    89 
    90     Sub Variant(p As *IDispatch)
    91         p->AddRef()
     82        SetPointer(VarPtr(v.val), ObjPtr(unk))
     83    End Sub
     84
     85    Sub Variant(disp As IDispatch)
     86        If Not IsNothing(disp) Then disp.AddRef()
    9287        v.vt = VT_DISPATCH
    93         SetPointer(VarPtr(v.val), p)
     88        SetPointer(VarPtr(v.val), ObjPtr(disp))
    9489    End Sub
    9590/*
     
    284279
    285280    Static Function Compare(x As Variant, y As Variant, lcid As LCID, flags As DWord) As HRESULT
    286         Return VarCmp(x.v, y.v, lcid, flags)
     281        Return VarCmp(removeNull(x).v, removeNull(y).v, lcid, flags)
    287282    End Function
    288283
     
    290285        Return VarCmp(x.v, y.v, LOCALE_USER_DEFAULT, 0) 'VARCMP_NULL = 3を返す場合があるので注意
    291286    End Function
    292 /*
     287
    293288    Const Function Operator ==(y As Variant) As Boolean
    294289        Dim c = Compare(This, y)
    295         If c = VARCMP_EQ Then
    296             Return True
    297         Else
    298             Return False
    299         End If
     290        Return c = VARCMP_EQ
    300291    End Function
    301292
    302293    Const Function Operator <>(y As Variant) As Boolean
    303294        Dim c = Compare(This, y)
    304         If c <> VARCMP_EQ Then
    305             Return True
    306         Else
    307             Return False
    308         End If
     295        Return c <> VARCMP_EQ
    309296    End Function
    310297
    311298    Const Function Operator <(y As Variant) As Boolean
    312299        Dim c = Compare(This, y)
    313         If c = VARCMP_LT Then
    314             Return True
    315         Else
    316             Return False
    317         End If
    318     End Function
    319 /*
     300        Return c = VARCMP_LT
     301    End Function
     302
    320303    Const Function Operator >(y As Variant) As Boolean
    321304        Dim c = Compare(This, y)
    322         If c = VARCMP_GT Then
    323             Return True
    324         Else
    325             Return False
    326         End If
    327     End Function
    328 */
    329 /*
     305        Return c = VARCMP_GT
     306    End Function
     307
    330308    Const Function Operator <=(y As Variant) As Boolean
    331309        Dim c = Compare(This, y)
    332         If c = VARCMP_LT Or c = VARCMP_EQ Then
    333             Return True
    334         Else
    335             Return False
    336         End If
     310        Return c = VARCMP_LT Or c = VARCMP_EQ
    337311    End Function
    338312
    339313    Const Function Operator >=(y As Variant) As Boolean
    340314        Dim c = Compare(This, y)
    341         If c = VARCMP_GT Or c = VARCMP_EQ Then
    342             Return True
    343         Else
    344             Return False
    345         End If
    346     End Function
    347 */
     315        Return c = VARCMP_GT Or c = VARCMP_EQ
     316    End Function
     317
    348318    Const Function ChangeType(vt As VARTYPE, flags As Word) As Variant
    349         Dim ret = New Variant
    350         ChangeType(ret, flags, vt)
    351         Return ret
     319        ChangeType = New Variant
     320        ChangeType(ChangeType, flags, vt)
    352321    End Function
    353322
     
    369338
    370339    Override Function ToString() As String
    371         Dim tmp = ChangeType(VT_BSTR, VARIANT_ALPHABOOL)
    372         Dim bs = ((tmp.v.val As ULONG_PTR) As BSTR)
    373         Return New String(bs As PCWSTR, SysStringLen(bs) As Long)
     340        /*Using*/ Dim bs = ValStr
     341        ToString = bs.ToString
     342        bstr.Dispose() 'End Using
    374343    End Function
    375344
     
    526495
    527496    Const Function ValStr() As BString
     497        ValStr = New BString
    528498        Dim r As VARIANT
    529499        ChangeType(r, VARIANT_ALPHABOOL, VT_BSTR)
    530         Dim bs = New BString
    531         bs.Attach(GetPointer(VarPtr(r.val)) As BSTR)
    532         Return bs
     500        ValStr.Attach(GetPointer(VarPtr(r.val)) As BSTR)
    533501    End Function
    534502
     
    536504        Clear()
    537505        v.vt = VT_BSTR
    538         SetPointer(VarPtr(v.val), x.Copy())
    539     End Sub
    540 
    541     Const Function ValUnknown() As *IUnknown
     506        If IsNothing(x) Then
     507            SetPointer(VarPtr(v.val), SysAllocStringLen(0))
     508        Else
     509            SetPointer(VarPtr(v.val), x.Copy())
     510        End If
     511    End Sub
     512
     513    Const Function ValUnknown() As IUnknown
    542514        Dim r As VARIANT
    543515        ChangeType(r, 0, VT_UNKNOWN)
    544         Return GetPointer(VarPtr(r.val)) As *IUnknown
    545     End Function
    546 
    547     Sub ValUnknown(x As *IUnknown)
    548         Clear()
    549         SetPointer(VarPtr(v.val), x)
    550         x->AddRef()
     516        Return _System_PtrUnknown(r.val As ULONG_PTR As VoidPtr)
     517    End Function
     518
     519    Sub ValUnknown(x As IUnknown)
     520        Clear()
     521        SetPointer(VarPtr(v.val), ObjPtr(x))
     522        If Not IsNothing(x) Then
     523            x.AddRef()
     524        End If
    551525        v.vt = VT_UNKNOWN
    552526    End Sub
     
    587561
    588562    Static Function OptionalParam() As Variant
    589 '       If _System_VariantOptionalParam = Nothing Then
    590 '           'ToDo マルチスレッド対応
    591             VariantOptionalParam = New Variant
    592             VariantOptionalParam.ValError = DISP_E_PARAMNOTFOUND
    593 '       End If
    594         Return VariantOptionalParam
     563        If IsNothing(optionalParam) Then
     564            Dim t = New Variant
     565            t.ValError = DISP_E_PARAMNOTFOUND
     566            InterlockedCompareExchangePointer(ByVal VarPtr(optionalParam), ObjPtr(t), 0)
     567        End If
     568        Return optionalParam
     569    End Function
     570
     571    Static Function Null() As Variant
     572        If IsNothing(optionalParam) Then
     573            Dim t = New Variant
     574            Dim p = t.PtrToVariant
     575            p->vt = VT_NULL
     576            InterlockedCompareExchangePointer(ByVal VarPtr(optionalParam), ObjPtr(t), 0)
     577        End If
     578        Return optionalParam
    595579    End Function
    596580Private
     
    605589'       src.vt = VT_EMPTY
    606590    End Sub
     591
     592    Static Function removeNull(v As Variant) As Varinat
     593        If IsNothing(v) Then
     594            removeNull = Null
     595        Else
     596            removeNull = v
     597        End If
     598    End Function
     599
     600    Static optionalParam = Nothing As Variant
     601    Static null = Nothing As Variant
    607602End Class
    608 
    609 Dim VariantOptionalParam = Nothing As Variant
    610603
    611604/*
     
    629622End Namespace 'COM
    630623End Namespace 'ActiveBasic
    631 
    632 #endif '_COM_VARIANT_AB
  • trunk/Include/objidl.sbp

    r411 r478  
    160160End Type
    161161
    162 Dim IID_IMultiQI = [&h00000020, &h0000, &h0000, [&hC0, &h00, &h00, &h00, &h00, &h00, &h00, &h46]] As IID
     162Dim IID_IMultiQI = [&h00000020, 0, 0, [&hC0, 0, 0, 0, 0, 0, 0, &h46]] As IID
    163163Interface IMultiQI
    164164    Inherits IUnknown
     
    169169End Interface
    170170
    171 ' AsyncIMultiQI
    172 
    173 ' IInternalUnknown
     171/* interface AsyncIMultiQI */
     172/* [uuid][local][object] */
     173
     174
     175Dim IID_AsyncIMultiQI = [&h000e0020, 0, 0, [&hC0, 0, 0, 0, 0, 0, 0, &h46]] As IID
     176Interface AsyncIMultiQI
     177    Inherits IUnknown
     178
     179    Function Begin_QueryMultipleInterfaces(
     180        /* [in] */ cMQIs As DWord,
     181        /* [out][in] */ pMQIs As *MULTI_QI) As HRESULT
     182    Function Finish_QueryMultipleInterfaces(
     183        /* [out][in] */ pMQIs As *MULTI_QI) As HRESULT
     184End Interface
     185
     186/* interface IInternalUnknown */
     187/* [uuid][local][object] */
     188Dim IID_IInternalUnknown = [&h00000021, 0, 0, [&hC0, 0, 0, 0, 0, 0, 0, &h46]] As IID
     189Interface IInternalUnknown
     190    Inherits IUnknown
     191
     192    Function QueryInternalInterface(
     193        /* [in] */ ByRef riid As IID,
     194        /* [out] */ ByRef ppv As Any) As HRESULT
     195End Interface
    174196
    175197/* interface IEnumUnknown */
     
    180202    Inherits IUnknown
    181203
    182     /* [local] */ Function Next_(
     204    /* [local] */ Function Next(
    183205        /* [in] */ celt As DWord,
    184206        /* [out] */ rgelt As *IUnknown,
     
    307329End Interface
    308330
    309 Dim IID_IPersist = [&h0000010c, &h0000, &h0000, [&hC0, &h00, &h00, &h00, &h00, &h00, &h00, &h46]] As IID
     331Dim IID_IPersist = [&h0000010c, 0, 0, [&hC0, 0, 0, 0, 0, 0, 0, &h46]] As IID
    310332Interface IPersist
    311333    Inherits IUnknown
     
    315337End Interface
    316338
    317 Dim IID_IPersistStream = [&h00000109, &h0000, &h0000, [&hC0, &h00, &h00, &h00, &h00, &h00, &h00, &h46]] As IID
     339Dim IID_IPersistStream = [&h00000109, 0, 0, [&hC0, 0, 0, 0, 0, 0, 0, &h46]] As IID
    318340Interface IPersistStream
    319341    Inherits IPersist
     
    484506End Enum
    485507
    486 Dim IID_IStream = [&h0000000c, &h0000, &h0000, [&hC0, &h00, &h00, &h00, &h00, &h00, &h00, &h46]] As IID
     508Dim IID_IStream = [&h0000000c, 0, 0, [&hC0, 0, 0, 0, 0, 0, 0, &h46]] As IID
    487509Interface IStream
    488510    Inherits ISequentialStream
     
    552574TypeDef SNB = /* [wire_marshal] */ **OLECHAR
    553575
    554 Dim IID_IStorage = [&h0000000b, &h0000, &h0000, [&hC0, &h00, &h00, &h00, &h00, &h00, &h00, &h46]] As IID
     576Dim IID_IStorage = [&h0000000b, 0, 0, [&hC0, 0, 0, 0, 0, 0, 0, &h46]] As IID
    555577Interface IStorage
    556578    Inherits IUnknown
     
    905927TypeDef LPINTERFACEINFO = *INTERFACEINFO
    906928
    907 Dim IID_IMessageFilter = [&h00000016, &h0000, &h0000, [&hC0, &h00, &h00, &h00, &h00, &h00, &h00, &h46]] As IID
     929Dim IID_IMessageFilter = [&h00000016, 0, 0, [&hC0, 0, 0, 0, 0, 0, 0, &h46]] As IID
    908930Interface IMessageFilter
    909931    Inherits IUnknown
     
    966988' ISurrogate
    967989
    968 ' IGlobalInterfaceTable
     990Dim IID_IGlobalInterfaceTable = [&h00000146, 0, 0, [&hC0, 0, 0, 0, 0, 0, 0, &h46]] As IID
     991Interface IGlobalInterfaceTable
     992    Inherits IUnknown
     993
     994    Function RegisterInterfaceInGlobal(
     995        /* [in] */ unk As IUnknown,
     996        /* [in] */ ByRef riid As IID,
     997        /* [out] */ ByRef dwCookie As DWord) As HRESULT
     998    Function RevokeInterfaceFromGlobal(
     999        /* [in] */ dwCookie As DWord) As HRESULT
     1000    Function GetInterfaceFromGlobal(
     1001        /* [in] */ dwCookie As DWord,
     1002        /* [in] */ ByRef riid As IID,
     1003        /* [iid_is][out] */ ByRef ppv As Any) As HRESULT
     1004End Interface
    9691005
    9701006' IDirectWriterLock
  • trunk/Include/ole2.ab

    r303 r478  
    88#require <objbase.sbp>
    99#require <oleauto.ab>
    10 
     10#ifdef __UNDEFINED '#165が解決するまでの暫定
    1111' View OBJECT Error Codes
    1212
     
    5656
    5757/* helper functions */
    58 Declare Function ReadClassStg Lib "ole32.dll" (/*IN*/ ByVal pStg As *IStorage, /*OUT*/ ByRef clsid As CLSID) As HRESULT
    59 Declare Function WriteClassStg Lib "ole32.dll" (/*IN*/ ByVal pStg As *IStorage, /*IN*/ ByRef clsid As CLSID) As HRESULT
    60 Declare Function ReadClassStm Lib "ole32.dll" (/*IN*/ ByVal pStm As *IStream, /*OUT*/ ByRef clsid As CLSID) As HRESULT
    61 Declare Function WriteClassStm Lib "ole32.dll" (/*IN*/ ByVal pStm As *IStream, /*IN*/ ByRef clsid As CLSID) As HRESULT
    62 Declare Function WriteFmtUserTypeStg Lib "ole32.dll" (/*IN*/ ByVal pstg As *IStorage, /*IN*/ ByVal cf As CLIPFORMAT, /*IN*/ ByVal pszUserType As *OLECHAR) As HRESULT
    63 Declare Function ReadFmtUserTypeStg Lib "ole32.dll" (/*IN*/ ByVal pstg As *IStorage, /*OUT*/ ByRef cf As CLIPFORMAT, /*OUT*/ ByRef rpszUserType As *OLECHAR) As HRESULT
     58Declare Function ReadClassStg Lib "ole32.dll" (/*IN*/ ByVal stg As IStorage, /*OUT*/ ByRef clsid As CLSID) As HRESULT
     59Declare Function WriteClassStg Lib "ole32.dll" (/*IN*/ ByVal stg As IStorage, /*IN*/ ByRef clsid As CLSID) As HRESULT
     60Declare Function ReadClassStm Lib "ole32.dll" (/*IN*/ ByVal stm As IStream, /*OUT*/ ByRef clsid As CLSID) As HRESULT
     61Declare Function WriteClassStm Lib "ole32.dll" (/*IN*/ ByVal stm As IStream, /*IN*/ ByRef clsid As CLSID) As HRESULT
     62Declare Function WriteFmtUserTypeStg Lib "ole32.dll" (/*IN*/ ByVal stg As IStorage, /*IN*/ ByVal cf As CLIPFORMAT, /*IN*/ ByVal pszUserType As *OLECHAR) As HRESULT
     63Declare Function ReadFmtUserTypeStg Lib "ole32.dll" (/*IN*/ ByVal stg As IStorage, /*OUT*/ ByRef cf As CLIPFORMAT, /*OUT*/ ByRef rpszUserType As *OLECHAR) As HRESULT
    6464
    6565
     
    7373   the data object */
    7474
    75 Declare Function OleQueryLinkFromData Lib "ole32" (/*IN*/ ByVal pSrcDataObject As *IDataObject) As HRESULT
    76 Declare Function OleQueryCreateFromData Lib "ole32.dll" (/*IN*/ ByVal pSrcDataObject As *IDataObject) As HRESULT
     75Declare Function OleQueryLinkFromData Lib "ole32" (/*IN*/ ByVal srcDataObject As IDataObject) As HRESULT
     76Declare Function OleQueryCreateFromData Lib "ole32.dll" (/*IN*/ ByVal srcDataObject As IDataObject) As HRESULT
    7777
    7878
    7979/* Object creation APIs */
    8080
    81 Declare Function OleCreate Lib "ole32.dll" (/*IN*/ ByRef rclsid As CLSID, /*IN*/ ByRef riid As IID, /*IN*/ ByVal renderopt As DWord, _
    82                 /*IN*/ ByVal pFormatEtc As *FORMATETC, /*IN*/ ByVal pClientSite As *IOleClientSite, _
    83                 /*IN*/ ByVal pStg As *IStorage, /*OUT*/ ByRef ppvObj As Any) As HRESULT
     81Declare Function OleCreate Lib "ole32.dll" (/*IN*/ ByRef rclsid As CLSID, /*IN*/ ByRef riid As IID, /*IN*/ ByVal renderopt As DWord,
     82    /*IN*/ ByVal pFormatEtc As *FORMATETC, /*IN*/ ByVal clientSite As IOleClientSite,
     83    /*IN*/ ByVal stg As IStorage, /*OUT*/ ByRef ppvObj As Any) As HRESULT
    8484
    8585Declare Function OleCreateEx Lib "ole32.dll" (/*IN*/ ByRef rclsid As CLSID, /*IN*/ ByRef riid As IID, /*IN*/ ByVal dwFlags As DWord,
    86                 /*IN*/ ByVal renderopt As DWord, /*IN*/ ByVal cFormats As DWord, /*IN*/ ByVal rgAdvf As *DWord,
    87                 /*IN*/ ByVal rgFormatEtc As *FORMATETC, /*IN*/ ByVal pAdviseSink As *IAdviseSink,
    88                 /*OUT*/ ByVal rgdwConnection As *DWord, /*IN*/ ByVal pClientSite As *IOleClientSite,
    89                 /*IN*/ ByVal pStg As *IStorage, /*OUT*/ ByRef ppvObj As Any) As HRESULT
    90 
    91 Declare Function OleCreateFromData Lib "ole32.dll" (/*IN*/ ByVal pSrcDataObj As *IDataObject, /*IN*/ ByRef riid As IID,
    92                 /*IN*/ ByVal renderopt As DWord, /*IN*/ ByVal pFormatEtc As *FORMATETC,
    93                 /*IN*/ ByVal pClientSite As *IOleClientSite, /*IN*/ ByVal pStg As *IStorage,
    94                 /*OUT*/ ByRef ppvObj As Any) As HRESULT
    95 
    96 Declare Function OleCreateFromDataEx Lib "ole32.dll" (/*IN*/ ByVal pSrcDataObj As *IDataObject, /*IN*/ ByRef riid As IID,
    97                 /*IN*/ ByVal dwFlags As DWord, /*IN*/ ByVal renderopt As DWord, /*IN*/ ByVal cFormats As DWord, /*IN*/ ByVal rgAdvf As *DWord,
    98                 /*IN*/ ByVal rgFormatEtc As *FORMATETC, /*IN*/ ByVal pAdviseSink As *IAdviseSink,
    99                 /*OUT*/ ByVal rgdwConnection As *DWord, /*IN*/ ByVal pClientSite As *IOleClientSite,
    100                 /*IN*/ ByVal pStg As *IStorage, /*OUT*/ ByRef ppvObj As Any) As HRESULT
    101 
    102 Declare Function OleCreateLinkFromData Lib "ole32.dll" (/*IN*/ ByVal pSrcDataObj As *IDataObject, /*IN*/ ByRef riid As IID,
    103                 /*IN*/ ByVal renderopt As DWord, /*IN*/ ByVal pFormatEtc As *FORMATETC,
    104                 /*IN*/ ByVal pClientSite As *IOleClientSite, /*IN*/ ByVal pStg As *IStorage,
    105                 /*OUT*/ ByRef ppvObj As Any) As HRESULT
    106 
    107 Declare Function OleCreateLinkFromDataEx Lib "ole32.dll" (/*IN*/ ByVal pSrcDataObj As *IDataObject, /*IN*/ ByRef riid As IID,
    108                 /*IN*/ ByVal dwFlags As DWord, /*IN*/ ByVal renderopt As DWord, /*IN*/ ByVal cFormats As DWord, /*IN*/ ByVal rgAdvf As *DWord,
    109                 /*IN*/ ByVal rgFormatEtc As *FORMATETC, /*IN*/ ByVal pAdviseSink As *IAdviseSink,
    110                 /*OUT IN*/ ByVal rgdwConnection As *DWord, /*IN*/ ByVal pClientSite As *IOleClientSite,
    111                 /*IN*/ ByVal pStg As *IStorage, /*OUT*/ ByRef ppvObj As Any) As HRESULT
    112 
    113 Declare Function OleCreateStaticFromData Lib "ole32.dll" (/*IN*/ ByVal pSrcDataObj As *IDataObject, /*IN*/ ByRef riid As IID,
    114                 /*IN*/ ByVal renderopt As DWord, /*IN*/ ByVal pFormatEtc As *FORMATETC,
    115                 /*IN*/ ByVal pClientSite As *IOleClientSite, /*IN*/ ByVal pStg As *IStorage,
    116                 /*OUT*/ ByRef ppvObj As Any) As HRESULT
    117 
    118 
    119 Declare Function OleCreateLink Lib "ole32.dll" (/*IN*/ ByVal pmkLinkSrc As *IMoniker, /*IN*/ ByRef riid As IID,
    120             /*IN*/ ByVal renderopt As DWord, /*IN*/ ByVal pFormatEtc As *FORMATETC,
    121             /*IN*/ ByVal pClientSite As *IOleClientSite, /*IN*/ ByVal pDataObj As *IDataObject, /*OUT*/ ByRef ppvObj As Any) As HRESULT
    122 
    123 Declare Function OleCreateLinkEx Lib "ole32.dll" (/*IN*/ ByVal pmkLinkSrc As *IMoniker, /*IN*/ ByRef riid As IID,
    124             /*IN*/ ByVal dwFlags As DWord, /*IN*/ ByVal renderopt As DWord, /*IN*/ ByVal cFormats As DWord, /*IN*/ ByVal rgAdvf As *DWord,
    125             /*IN*/ ByVal rgFormatEtc As *FORMATETC, /*IN*/ ByVal pAdviseSink As *IAdviseSink,
    126             /*OUT*/ ByVal rgdwConnection As *DWord, /*IN*/ ByVal pClientSite As *IOleClientSite,
    127             /*IN*/ ByVal pDataObj As *IDataObject, /*OUT*/ ByRef ppvObj As Any) As HRESULT
     86    /*IN*/ ByVal renderopt As DWord, /*IN*/ ByVal cFormats As DWord, /*IN*/ ByVal rgAdvf As *DWord,
     87    /*IN*/ ByVal rgFormatEtc As *FORMATETC, /*IN*/ ByVal adviseSink As IAdviseSink,
     88    /*OUT*/ ByVal rgdwConnection As *DWord, /*IN*/ ByVal clientSite As IOleClientSite,
     89    /*IN*/ ByVal stg As IStorage, /*OUT*/ ByRef ppvObj As Any) As HRESULT
     90
     91Declare Function OleCreateFromData Lib "ole32.dll" (/*IN*/ ByVal srcDataObj As IDataObject, /*IN*/ ByRef riid As IID,
     92    /*IN*/ ByVal renderopt As DWord, /*IN*/ ByVal pFormatEtc As *FORMATETC,
     93    /*IN*/ ByVal clientSite As IOleClientSite, /*IN*/ ByVal stg As IStorage,
     94    /*OUT*/ ByRef ppvObj As Any) As HRESULT
     95
     96Declare Function OleCreateFromDataEx Lib "ole32.dll" (/*IN*/ ByVal srcDataObj As IDataObject, /*IN*/ ByRef riid As IID,
     97    /*IN*/ ByVal dwFlags As DWord, /*IN*/ ByVal renderopt As DWord, /*IN*/ ByVal cFormats As DWord, /*IN*/ ByVal rgAdvf As *DWord,
     98    /*IN*/ ByVal rgFormatEtc As *FORMATETC, /*IN*/ ByVal adviseSink As IAdviseSink,
     99    /*OUT*/ ByVal rgdwConnection As *DWord, /*IN*/ ByVal clientSite As IOleClientSite,
     100    /*IN*/ ByVal stg As IStorage, /*OUT*/ ByRef ppvObj As Any) As HRESULT
     101
     102Declare Function OleCreateLinkFromData Lib "ole32.dll" (/*IN*/ ByVal srcDataObj As IDataObject, /*IN*/ ByRef riid As IID,
     103    /*IN*/ ByVal renderopt As DWord, /*IN*/ ByVal pFormatEtc As *FORMATETC,
     104    /*IN*/ ByVal clientSite As IOleClientSite, /*IN*/ ByVal stg As IStorage,
     105    /*OUT*/ ByRef ppvObj As Any) As HRESULT
     106
     107Declare Function OleCreateLinkFromDataEx Lib "ole32.dll" (/*IN*/ ByVal srcDataObj As IDataObject, /*IN*/ ByRef riid As IID,
     108    /*IN*/ ByVal dwFlags As DWord, /*IN*/ ByVal renderopt As DWord, /*IN*/ ByVal cFormats As DWord, /*IN*/ ByVal rgAdvf As *DWord,
     109    /*IN*/ ByVal rgFormatEtc As *FORMATETC, /*IN*/ ByVal adviseSink As IAdviseSink,
     110    /*OUT IN*/ ByVal rgdwConnection As *DWord, /*IN*/ ByVal clientSite As IOleClientSite,
     111    /*IN*/ ByVal stg As IStorage, /*OUT*/ ByRef ppvObj As Any) As HRESULT
     112
     113Declare Function OleCreateStaticFromData Lib "ole32.dll" (/*IN*/ ByVal srcDataObj As IDataObject, /*IN*/ ByRef riid As IID,
     114    /*IN*/ ByVal renderopt As DWord, /*IN*/ ByVal pFormatEtc As *FORMATETC,
     115    /*IN*/ ByVal clientSite As IOleClientSite, /*IN*/ ByVal stg As IStorage,
     116    /*OUT*/ ByRef ppvObj As Any) As HRESULT
     117
     118
     119Declare Function OleCreateLink Lib "ole32.dll" (/*IN*/ ByVal mkLinkSrc As IMoniker, /*IN*/ ByRef riid As IID,
     120    /*IN*/ ByVal renderopt As DWord, /*IN*/ ByVal pFormatEtc As *FORMATETC,
     121    /*IN*/ ByVal clientSite As IOleClientSite, /*IN*/ ByVal dataObj As IDataObject, /*OUT*/ ByRef ppvObj As Any) As HRESULT
     122
     123Declare Function OleCreateLinkEx Lib "ole32.dll" (/*IN*/ ByVal mkLinkSrc As IMoniker, /*IN*/ ByRef riid As IID,
     124    /*IN*/ ByVal dwFlags As DWord, /*IN*/ ByVal renderopt As DWord, /*IN*/ ByVal cFormats As DWord, /*IN*/ ByVal rgAdvf As *DWord,
     125    /*IN*/ ByVal rgFormatEtc As *FORMATETC, /*IN*/ ByVal adviseSink As IAdviseSink,
     126    /*OUT*/ ByVal rgdwConnection As *DWord, /*IN*/ ByVal clientSite As IOleClientSite,
     127    /*IN*/ ByVal dataObj As IDataObject, /*OUT*/ ByRef ppvObj As Any) As HRESULT
    128128
    129129Declare Function OleCreateLinkToFile Lib "ole32.dll" (/*IN*/ ByVal lpszFileName As LPCOLESTR, /*IN*/ ByRef riid As IID,
    130             /*IN*/ ByVal renderopt As DWord, /*IN*/ ByVal pFormatEtc As *FORMATETC,
    131             /*IN*/ ByVal pClientSite As *IOleClientSite, /*IN*/ ByVal pDataObj As *IDataObject, /*OUT*/ ByRef ppvObj As Any) As HRESULT
     130    /*IN*/ ByVal renderopt As DWord, /*IN*/ ByVal pFormatEtc As *FORMATETC,
     131    /*IN*/ ByVal clientSite As IOleClientSite, /*IN*/ ByValdataObj As IDataObject, /*OUT*/ ByRef ppvObj As Any) As HRESULT
    132132
    133133Declare Function OleCreateLinkToFileEx Lib "ole32.dll" (/*IN*/ ByVal lpszFileName As LPCOLESTR, /*IN*/ ByRef riid As IID,
    134             /*IN*/ ByVal dwFlags As DWord, /*IN*/ ByVal renderopt As DWord, /*IN*/ ByVal cFormats As DWord, /*IN*/ ByVal rgAdvf As *DWord,
    135             /*IN*/ ByVal rgFormatEtc As *FORMATETC, /*IN*/ ByVal pAdviseSink As *IAdviseSink,
    136             /*OUT*/ ByVal rgdwConnection As *DWord, /*IN*/ ByVal pClientSite As *IOleClientSite,
    137             /*IN*/ ByVal pDataObj As *IDataObject, /*OUT*/ ByRef ppvObj As Any) As HRESULT
     134    /*IN*/ ByVal dwFlags As DWord, /*IN*/ ByVal renderopt As DWord, /*IN*/ ByVal cFormats As DWord, /*IN*/ ByVal rgAdvf As *DWord,
     135    /*IN*/ ByVal rgFormatEtc As *FORMATETC, /*IN*/ ByVal adviseSink As IAdviseSink,
     136    /*OUT*/ ByVal rgdwConnection As *DWord, /*IN*/ ByVal clientSite As IOleClientSite,
     137    /*IN*/ ByVal dataObj As IDataObject, /*OUT*/ ByRef ppvObj As Any) As HRESULT
    138138
    139139Declare Function OleCreateFromFile Lib "ole32.dll" (/*IN*/ ByRef rclsid As CLSID, /*IN*/ ByVal lpszFileName As LPOLESTR, /*IN*/ ByRef riid As IID,
    140             /*IN*/ ByVal renderopt As DWord, /*IN*/ ByVal pFormatEtc As *FORMATETC,
    141             /*IN*/ ByVal pClientSite As *IOleClientSite, /*IN*/ ByVal pDataObj As *IDataObject, /*OUT*/ ByRef ppvObj As Any) As HRESULT
     140    /*IN*/ ByVal renderopt As DWord, /*IN*/ ByVal pFormatEtc As *FORMATETC,
     141    /*IN*/ ByVal clientSite As IOleClientSite, /*IN*/ ByVal dataObj As IDataObject, /*OUT*/ ByRef ppvObj As Any) As HRESULT
    142142
    143143Declare Function OleCreateFromFileEx Lib "ole32.dll" (/*IN*/ ByRef rclsid As CLSID, /*IN*/ ByVal lpszFileName As LPOLESTR, /*IN*/ ByRef riid As IID,
    144             /*IN*/ ByVal dwFlags As DWord, /*IN*/ ByVal renderopt As DWord, /*IN*/ ByVal cFormats As DWord, /*IN*/ ByVal rgAdvf As *DWord,
    145             /*IN*/ ByVal rgFormatEtc As *FORMATETC, /*IN*/ ByVal pAdviseSink As *IAdviseSink,
    146             /*OUT*/ ByVal rgdwConnection As *DWord, /*IN*/ ByVal pClientSite As *IOleClientSite,
    147             /*IN*/ ByVal pDataObj As *IDataObject, /*OUT*/ ByRef ppvObj As Any) As HRESULT
    148 
    149 Declare Function OleLoad Lib "ole32.dll" (/*IN*/ ByVal pStg As *IStorage, /*IN*/ ByRef riid As IID, /*IN*/ ByVal pClientSite As *IOleClientSite,
    150             /*OUT*/ ByRef ppvObj As Any) As HRESULT
    151 
    152 Declare Function OleSave Lib "ole32.dll" (/*IN*/ ByVal pPS As *IPersistStorage, /*IN*/ ByVal pStg As *IStorage, /*IN*/ fSameAsLoad As BOOL) As HRESULT
    153 
    154 Declare Function OleLoadFromStream Lib "ole32.dll" ( /*IN*/ ByVal pStm As *IStream, /*IN*/ ByRef iidInterface As IID, /*OUT*/ ByRef ppvObj As Any) As HRESULT
    155 Declare Function OleSaveToStream Lib "ole32.dll" ( /*IN*/ ByVal pPStm As *IPersistStream, /*IN*/ ByVal pStm As *IStream) As HRESULT
    156 
    157 
    158 Declare Function OleSetContainedObject Lib "ole32.dll" (/*IN*/ ByVal pUnknown As *IUnknown, /*IN*/ ByVal fContained As BOOL) As HRESULT
    159 Declare Function OleNoteObjectVisible Lib "ole32.dll" (/*IN*/ ByVal pUnknown As *IUnknown, /*IN*/ ByVal fContained As BOOL) As HRESULT
     144    /*IN*/ ByVal dwFlags As DWord, /*IN*/ ByVal renderopt As DWord, /*IN*/ ByVal cFormats As DWord, /*IN*/ ByVal rgAdvf As *DWord,
     145    /*IN*/ ByVal rgFormatEtc As *FORMATETC, /*IN*/ ByVal adviseSink As IAdviseSink,
     146    /*OUT*/ ByVal rgdwConnection As *DWord, /*IN*/ ByVal clientSite As IOleClientSite,
     147    /*IN*/ ByVal dataObj As IDataObject, /*OUT*/ ByRef ppvObj As Any) As HRESULT
     148
     149Declare Function OleLoad Lib "ole32.dll" (/*IN*/ ByVal stg As IStorage, /*IN*/ ByRef riid As IID, /*IN*/ ByVal clientSite As IOleClientSite,
     150    /*OUT*/ ByRef ppvObj As Any) As HRESULT
     151
     152Declare Function OleSave Lib "ole32.dll" (/*IN*/ ByVal ps As IPersistStorage, /*IN*/ ByVal stg As IStorage, /*IN*/ fSameAsLoad As BOOL) As HRESULT
     153
     154Declare Function OleLoadFromStream Lib "ole32.dll" ( /*IN*/ ByVal stm As IStream, /*IN*/ ByRef iidInterface As IID, /*OUT*/ ByRef ppvObj As Any) As HRESULT
     155Declare Function OleSaveToStream Lib "ole32.dll" ( /*IN*/ ByVal pstm As IPersistStream, /*IN*/ ByVal stm As IStream) As HRESULT
     156
     157
     158Declare Function OleSetContainedObject Lib "ole32.dll" (/*IN*/ ByVal unknown As IUnknown, /*IN*/ ByVal fContained As BOOL) As HRESULT
     159Declare Function OleNoteObjectVisible Lib "ole32.dll" (/*IN*/ ByVal unknown As IUnknown, /*IN*/ ByVal fContained As BOOL) As HRESULT
    160160
    161161
    162162/* Drag/Drop APIs */
    163163
    164 Declare Function RegisterDragDrop Lib "ole32.dll" (/*IN*/ ByVal hwnd As HWND, /*IN*/ ByVal pDropTarget As *IDropTarget) As HRESULT
     164Declare Function RegisterDragDrop Lib "ole32.dll" (/*IN*/ ByVal hwnd As HWND, /*IN*/ ByVal dropTarget As IDropTarget) As HRESULT
    165165Declare Function RevokeDragDrop Lib "ole32.dll" (/*IN*/ ByVal hwnd As HWND) As HRESULT
    166 Declare Function DoDragDrop Lib "ole32.dll" (/*IN*/ ByVal pDataObj As *IDataObject, /*IN*/ ByVal pDropSource As *IDropSource,
    167             /*IN*/ ByVal dwOKEffects As DWord, /*OUT*/ ByRef dwEffect As DWord) As HRESULT
     166Declare Function DoDragDrop Lib "ole32.dll" (/*IN*/ ByVal dataObj As IDataObject, /*IN*/ ByVal dropSource As IDropSource,
     167    /*IN*/ ByVal dwOKEffects As DWord, /*OUT*/ ByRef dwEffect As DWord) As HRESULT
    168168
    169169/* Clipboard APIs */
    170170
    171 Declare Function OleSetClipboard Lib "ole32.dll" (/*IN*/ ByVal pDataObj As *IDataObject) As HRESULT
    172 Declare Function OleGetClipboard Lib "ole32.dll" (/*OUT*/ ByRef pDataObj As *IDataObject) As HRESULT
     171Declare Function OleSetClipboard Lib "ole32.dll" (/*IN*/ ByVal dataObj As IDataObject) As HRESULT
     172Declare Function OleGetClipboard Lib "ole32.dll" (/*OUT*/ ByRef dataObj As IDataObject) As HRESULT
    173173Declare Function OleFlushClipboard Lib "ole32.dll" () As HRESULT
    174 Declare Function OleIsCurrentClipboard Lib "ole32.dll" (/*IN*/ ByVal pDataObj As *IDataObject) As HRESULT
     174Declare Function OleIsCurrentClipboard Lib "ole32.dll" (/*IN*/ ByVal dataObj As IDataObject) As HRESULT
    175175
    176176
     
    189189End Type
    190190Declare Function OleCreateMenuDescriptor Lib "ole32.dll" (/*IN*/ ByVal hmenuCombined As HMENU,
    191                                 /*IN*/ ByRef MenuWidths As OLEMENUGROUPWIDTHS) As HOLEMENU
     191    /*IN*/ ByRef MenuWidths As OLEMENUGROUPWIDTHS) As HOLEMENU
    192192Declare Function OleSetMenuDescriptor Lib "ole32.dll" (/*IN*/ ByVal holemenu As HOLEMENU, /*IN*/ ByVal hwndFrame As HWND,
    193                                 /*IN*/ ByVal hwndActiveObject As HWND,
    194                                 /*IN*/ ByVal pFrame As *IOleInPlaceFrame,
    195                                 /*IN*/ ByVal pActiveObj As *IOleInPlaceActiveObject) As HRESULT
     193    /*IN*/ ByVal hwndActiveObject As HWND,
     194    /*IN*/ ByVal frame As IOleInPlaceFrame,
     195    /*IN*/ ByVal activeObj As IOleInPlaceActiveObject) As HRESULT
    196196Declare Function OleDestroyMenuDescriptor Lib "ole32.dll" (/*IN*/ ByVal holemenu As HOLEMENU) As HRESULT
    197197
    198 Declare Function OleTranslateAccelerator Lib "ole32.dll" (/*IN*/ ByVal pFrame As *IOleInPlaceFrame,
    199                             /*IN*/ ByRef FrameInfo As OLEINPLACEFRAMEINFO, /*IN*/ ByRef msg As MSG) As HRESULT
     198Declare Function OleTranslateAccelerator Lib "ole32.dll" (/*IN*/ ByVal frame As IOleInPlaceFrame,
     199    /*IN*/ ByRef FrameInfo As OLEINPLACEFRAMEINFO, /*IN*/ ByRef msg As MSG) As HRESULT
    200200
    201201
    202202/* Helper APIs */
    203203Declare Function OleDuplicateData Lib "ole32.dll" (/*IN*/ ByVal hSrc As HANDLE, /*IN*/ ByVal cfFormat As CLIPFORMAT,
    204                         /*IN*/ ByVal uiFlags As DWord) As HANDLE
    205 
    206 Declare Function OleDraw Lib "ole32.dll" (/*IN*/ ByVal pUnknown As *IUnknown, /*IN*/ ByVal dwAspect As DWord, /*IN*/ ByVal hdcDraw As HDC,
    207                     /*IN*/ ByRef rcBounds As RECT) As HRESULT
    208 
    209 Declare Function OleRun Lib "ole32.dll" (/*IN*/ ByVal pUnknown As *IUnknown) As HRESULT
    210 Declare Function OleIsRunning Lib "ole32.dll" (/*IN*/ ByVal pObject As *IOleObject) As BOOL
    211 Declare Function OleLockRunning Lib "ole32.dll" (/*IN*/ ByVal pUnknown As *IUnknown, /*IN*/ ByVal fLock As BOOL, /*IN*/ ByVal fLastUnlockCloses As BOOL) As HRESULT
     204    /*IN*/ ByVal uiFlags As DWord) As HANDLE
     205
     206Declare Function OleDraw Lib "ole32.dll" (/*IN*/ ByVal unknown As IUnknown, /*IN*/ ByVal dwAspect As DWord, /*IN*/ ByVal hdcDraw As HDC,
     207    /*IN*/ ByRef rcBounds As RECT) As HRESULT
     208
     209Declare Function OleRun Lib "ole32.dll" (/*IN*/ ByVal unknown As IUnknown) As HRESULT
     210Declare Function OleIsRunning Lib "ole32.dll" (/*IN*/ ByVal object As IOleObject) As BOOL
     211Declare Function OleLockRunning Lib "ole32.dll" (/*IN*/ ByVal unknown As IUnknown, /*IN*/ ByVal fLock As BOOL, /*IN*/ ByVal fLastUnlockCloses As BOOL) As HRESULT
    212212Declare Sub      ReleaseStgMedium Lib "ole32.dll" (/*IN*/ ByRef medium As STGMEDIUM)
    213 Declare Function CreateOleAdviseHolder Lib "ole32.dll" (/*OUT*/ ByRef pOAHolder As *IOleAdviseHolder) As HRESULT
    214 
    215 Declare Function OleCreateDefaultHandler Lib "ole32.dll" (/*IN*/ ByRef clsid As CLSID, /*IN*/ ByVal pUnkOuter As *IUnknown,
    216                     /*IN*/ ByRef riid As IID, /*OUT*/ ByRef pObj As Any) As HRESULT
    217 
    218 Declare Function OleCreateEmbeddingHelper Lib "ole32.dll" (/*IN*/ ByRef clsid As CLSID, /*IN*/ ByVal pUnkOuter As *IUnknown,
    219                     /*IN*/ ByVal flags As DWord, /*IN*/ ByVal pCF As *IClassFactory,
    220                     /*IN*/ ByRef riid As IID, /*OUT*/ ByRef pObj As Any) As HRESULT
     213Declare Function CreateOleAdviseHolder Lib "ole32.dll" (/*OUT*/ ByRef oaHolder As IOleAdviseHolder) As HRESULT
     214
     215Declare Function OleCreateDefaultHandler Lib "ole32.dll" (/*IN*/ ByRef clsid As CLSID, /*IN*/ ByVal unkOuter As IUnknown,
     216    /*IN*/ ByRef riid As IID, /*OUT*/ ByRef pObj As Any) As HRESULT
     217
     218Declare Function OleCreateEmbeddingHelper Lib "ole32.dll" (/*IN*/ ByRef clsid As CLSID, /*IN*/ ByVal ukOuter As IUnknown,
     219    /*IN*/ ByVal flags As DWord, /*IN*/ ByVal cf As IClassFactory,
     220    /*IN*/ ByRef riid As IID, /*OUT*/ ByRef pObj As Any) As HRESULT
    221221
    222222Declare Function IsAccelerator Lib "ole32.dll" (/*IN*/ ByVal hAccel As HACCEL, /*IN*/ ByVal cAccelEntries As Long, /*IN*/ ByRef msg As MSG,
    223                                         /*OUT*/ ByVal pwCmd As *Word) As BOOL
     223    /*OUT*/ ByVal pwCmd As *Word) As BOOL
    224224/* Icon extraction Helper APIs */
    225225
     
    227227
    228228Declare Function OleGetIconOfClass Lib "ole32.dll" (/*IN*/ ByRef rclsid As CLSID, /*IN*/ ByVal lpszLabel As LPOLESTR,
    229                                         /*IN*/ ByVal fUseTypeAsLabel As BOOL) As HGLOBAL
     229    /*IN*/ ByVal fUseTypeAsLabel As BOOL) As HGLOBAL
    230230
    231231Declare Function OleMetafilePictFromIconAndLabel Lib "ole32.dll" (/*IN*/ ByVal hIcon As HICON, /*IN*/ ByVal lpszLabel As LPOLESTR,
    232                                         /*IN*/ ByVal lpszSourceFile As LPOLESTR, /*IN*/ ByVal iIconIndex As DWord) As HGLOBAL
     232    /*IN*/ ByVal lpszSourceFile As LPOLESTR, /*IN*/ ByVal iIconIndex As DWord) As HGLOBAL
    233233
    234234
     
    237237
    238238Declare Function OleRegGetUserType Lib "ole32.dll" (/*IN*/ ByRef rclsid As CLSID, /*IN*/ ByVal dwFormOfType As DWord,
    239                                         /*OUT*/ ByVal pszUserType As LPOLESTR) As HRESULT
     239    /*OUT*/ ByVal pszUserType As LPOLESTR) As HRESULT
    240240
    241241Declare Function OleRegGetMiscStatus Lib "ole32.dll" (/*IN*/ ByRef rclsid As CLSID, /*IN*/ ByVal dwAspect As DWord,
    242                                         /*OUT*/ ByRef dwStatus As DWord) As HRESULT
     242    /*OUT*/ ByRef dwStatus As DWord) As HRESULT
    243243
    244244Declare Function OleRegEnumFormatEtc Lib "ole32.dll" (/*IN*/ ByRef rclsid As CLSID, /*IN*/ ByVal dwDirection As DWord,
    245                                         /*OUT*/ ByRef penum As *IEnumFORMATETC) As HRESULT
     245    /*OUT*/ ByRef penum As *IEnumFORMATETC) As HRESULT
    246246
    247247Declare Function OleRegEnumVerbs Lib "ole32.dll" (/*IN*/ ByRef rclsid As CLSID, /*OUT*/ ByRef penum As *IEnumOLEVERB) As HRESULT
     
    259259
    260260
    261 Declare Function OleConvertOLESTREAMToIStorage Lib "ole32.dll" ( _
    262     /*IN*/ ByVal lpolestream As LPOLESTREAM,
    263     /*OUT*/ ByVal pstg As *IStorage,
    264     /*IN*/ ByRef td As DVTARGETDEVICE) As HRESULT
    265 
    266 Declare Function OleConvertIStorageToOLESTREAM Lib "ole32.dll" ( _
    267     /*IN*/ ByVal pstg As *IStorage,
    268     /*OUT*/ ByVal lpolestream As LPOLESTREAM) As HRESULT
     261Declare Function OleConvertOLESTREAMToIStorage Lib "ole32.dll" (
     262    /*IN*/ ByVal lpolestream As LPOLESTREAM,
     263    /*OUT*/ ByVal stg As IStorage,
     264    /*IN*/ ByRef td As DVTARGETDEVICE) As HRESULT
     265
     266Declare Function OleConvertIStorageToOLESTREAM Lib "ole32.dll" (
     267    /*IN*/ ByVal stg As IStorage,
     268    /*OUT*/ ByVal lpolestream As LPOLESTREAM) As HRESULT
    269269
    270270
     
    272272Declare Function GetHGlobalFromILockBytes Lib "ole32.dll" (/*IN*/ ByVal plkbyt As *ILockBytes, /*OUT*/ ByRef hglobal As HGLOBAL) As HRESULT
    273273Declare Function CreateILockBytesOnHGlobal Lib "ole32.dll" (/*IN*/ ByVal hGlobal As HGLOBAL, /*IN*/ ByVal fDeleteOnRelease As BOOL,
    274                                     /*OUT*/ ByRef pplkbyt As *ILockBytes) As HRESULT
     274    /*OUT*/ ByRef lkbyt As ILockBytes) As HRESULT
    275275
    276276Declare Function GetHGlobalFromStream Lib "ole32.dll" (/*IN*/ ByVal pstm As *IStream, /*OUT*/ ByRef hglobal As HGLOBAL) As HRESULT
    277277Declare Function CreateStreamOnHGlobal Lib "ole32.dll" (/*IN*/ ByVal hGlobal As HGLOBAL, /*IN*/ ByVal fDeleteOnRelease As BOOL,
    278                                 /*OUT*/ ByRef pstm As *IStream) As HRESULT
     278    /*OUT*/ ByRef stm As IStream) As HRESULT
    279279
    280280
    281281/* ConvertTo APIS */
    282282
    283 Declare Function OleDoAutoConvert Lib "ole32.dll" (/*IN*/ ByRef pStg As *IStorage, /*OUT*/ ByRef ClsidNew As CLSID) As HRESULT
     283Declare Function OleDoAutoConvert Lib "ole32.dll" (/*IN*/ ByRef stg As IStorage, /*OUT*/ ByRef ClsidNew As CLSID) As HRESULT
    284284Declare Function OleGetAutoConvert Lib "ole32.dll" (/*IN*/ ByRef clsidOld As CLSID, /*OUT*/ ByRef ClsidNew As CLSID) As HRESULT
    285285Declare Function OleSetAutoConvert Lib "ole32.dll" (/*IN*/ ByRef clsidOld As CLSID, /*IN*/ ByRef ClsidNew As CLSID) As HRESULT
    286 Declare Function GetConvertStg Lib "ole32.dll" (/*IN*/ ByVal pStg As *IStorage) As HRESULT
    287 Declare Function SetConvertStg Lib "ole32.dll" (/*IN*/ ByVal pStg As *IStorage, /*IN*/ fConvert As BOOL) As HRESULT
     286Declare Function GetConvertStg Lib "ole32.dll" (/*IN*/ ByVal stg As IStorage) As HRESULT
     287Declare Function SetConvertStg Lib "ole32.dll" (/*IN*/ ByVal stg As IStorage, /*IN*/ fConvert As BOOL) As HRESULT
    288288
    289289
    290290Declare Function OleConvertIStorageToOLESTREAMEx Lib "ole32.dll" ( _
    291     /*IN*/ ByVal pstg As *IStorage,       ' Presentation data to OLESTREAM
    292     /*IN*/ ByVal cfFormat As CLIPFORMAT,  '       format
    293     /*IN*/ ByVal lWidth As Long,          '       width
    294     /*IN*/ ByVal lHeight As Long,         '       height
    295     /*IN*/ ByVal dwSize As DWORD,         '       size in bytes
    296     /*IN*/ ByRef medium As STGMEDIUM,     '       bits
    297     /*OUT*/ ByVal polestm As LPOLESTREAM) As HRESULT
     291    /*IN*/ ByVal stg As IStorage,       ' Presentation data to OLESTREAM
     292    /*IN*/ ByVal cfFormat As CLIPFORMAT,  '       format
     293    /*IN*/ ByVal lWidth As Long,          '       width
     294    /*IN*/ ByVal lHeight As Long,         '       height
     295    /*IN*/ ByVal dwSize As DWORD,         '       size in bytes
     296    /*IN*/ ByRef medium As STGMEDIUM,     '       bits
     297    /*OUT*/ ByVal polestm As LPOLESTREAM) As HRESULT
    298298
    299299Declare Function OleConvertOLESTREAMToIStorageEx Lib "ole32.dll" ( _
    300     /*IN*/ ByVal polestm As LPOLESTREAM,
    301     /*OUT*/ ByVal pstg As *IStorage,' Presentation data from OLESTREAM
    302     /*OUT*/ ByRef pcfFormat As CLIPFORMAT, '       format
    303     /*OUT*/ ByRef plwWidth As Long,        '       width
    304     /*OUT*/ ByRef plHeight As Long,        '       height
    305     /*OUT*/ ByRef pdwSize As DWord,        '       size in bytes
    306     /*OUT*/ ByRef medium As STGMEDIUM) As HRESULT   '      bits
     300    /*IN*/ ByVal polestm As LPOLESTREAM,
     301    /*OUT*/ ByVal pstg As *IStorage,' Presentation data from OLESTREAM
     302    /*OUT*/ ByRef pcfFormat As CLIPFORMAT, '       format
     303    /*OUT*/ ByRef plwWidth As Long,        '       width
     304    /*OUT*/ ByRef plHeight As Long,        '       height
     305    /*OUT*/ ByRef pdwSize As DWord,        '       size in bytes
     306    /*OUT*/ ByRef medium As STGMEDIUM) As HRESULT   '      bits
    307307
    308308' olectl.h
    309 Declare Function OleLoadPicture Lib "olepro32" (pStream As *IStream, lSize As Long, fRunmode As BOOL, ByRef riid As IID, ppvObj As VoidPtr) As HRESULT
    310 
     309Declare Function OleLoadPicture Lib "olepro32" (stream As IStream, lSize As Long, fRunmode As BOOL, ByRef riid As IID, ppvObj As VoidPtr) As HRESULT
     310#endif '__UNDEFINED
    311311#endif ' __OLE2_AB__
  • trunk/Include/oleidl.ab

    r303 r478  
    130130End Enum
    131131
    132 Dim IID_IOleObject = [&h00000112, &h0000, &h0000, [&hC0, &h00, &h00, &h00, &h00, &h00, &h00, &h46]] As IID
     132Dim IID_IOleObject = [&h00000112, 0, 0, [&hC0, 0, 0, 0, 0, 0, 0, &h46]] As IID
    133133Interface IOleObject
    134134    Inherits IUnknown
  • trunk/Include/system/string.sbp

    r398 r478  
    55#define _INC_BASIC_STRING
    66
    7 #require <Classes/System/String.ab>
    8 #require <Classes/System/Text/StringBuilder.ab>
    9 
    10 Function StrPtr(s As String) As *StrChar
     7Function StrPtr(s As String) As *Char
    118    If Not ActiveBasic.IsNothing(s) Then
    129        StrPtr = s.StrPtr
     
    6259出力関数: wcs(z)出力GetStr, mbs(z)出力GetStr,
    6360          wcs(z)出力GetStrNT, mbs(z)出力GetStrNT,
    64           GetWCStr, GetMBStr, GetTCStr, GetSCStr,
    65           ToWCStr, ToMBStr, ToTCStr, ToSCStr
    66 で、5 * 12 = 60通り。
     61          GetWCStr, GetMBStr, GetTCStr,
     62          ToWCStr, ToMBStr, ToTCStr,
     63で、5 * 10 = 50通り。
    6764*/
    6865
     
    261258End Function
    262259
    263 Function GetSCStr(mbszSrc As PSTR, ByRef ssDst As *StrChar) As SIZE_T
    264     Return GetStr(mbszSrc, ssDst)
    265 End Function
    266 
    267 Function GetSCStr(mbsSrc As PSTR, len As SIZE_T, ByRef ssDst As *StrChar) As SIZE_T
    268     Return GetStr(mbsSrc, len, ssDst)
    269 End Function
    270 
    271 Function GetSCStr(wcszSrc As PWSTR, ByRef ssDst As *StrChar) As SIZE_T
    272     Return GetStr(wcszSrc, ssDst)
    273 End Function
    274 
    275 Function GetSCStr(wcsSrc As PWSTR, len As SIZE_T, ByRef ssDst As *StrChar) As SIZE_T
    276     Return GetStr(wcsSrc, len, ssDst)
    277 End Function
    278 
    279 Function GetSCStr(strSrc As String, ByRef ssDst As *StrChar) As SIZE_T
    280     Return GetStr(strSrc.StrPtr, strSrc.Length As SIZE_T, ssDst)
    281 End Function
    282 
    283260Function ToWCStr(mbsz As PSTR) As PWSTR
    284261    GetStrNT(mbsz, ToWCStr)
     
    339316Function ToTCStr(s As String) As PCTSTR
    340317    GetStrNT(s, ToTCStr)
    341 End Function
    342 
    343 Function ToSCStr(mbsz As PSTR) As *StrChar
    344     GetStrNT(mbsz, ToSCStr)
    345 End Function
    346 
    347 Function ToSCStr(mbs As PSTR, len As SIZE_T) As *StrChar
    348     GetStrNT(mbs, len, ToSCStr)
    349 End Function
    350 
    351 Function ToSCStr(wcsz As PWSTR) As *StrChar
    352     GetStrNT(wcsz, ToSCStr)
    353 End Function
    354 
    355 Function ToSCStr(wcs As PWSTR, len As SIZE_T) As *StrChar
    356     GetStrNT(wcs, len, ToSCStr)
    357 End Function
    358 
    359 Function ToSCStr(s As String) As *StrChar
    360     ToSCStr = StrPtr(s)
    361318End Function
    362319
Note: See TracChangeset for help on using the changeset viewer.