Changeset 478
- Timestamp:
- Mar 13, 2008, 9:06:43 PM (17 years ago)
- Location:
- trunk/Include
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Include/Classes/ActiveBasic/Strings/Strings.ab
r457 r478 1 1 '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>8 2 9 3 Namespace ActiveBasic … … 220 214 End Namespace 'ActiveBasic 221 215 222 #endif '__ACTIVEBASIC_STRINGS_STRINGS_AB__ -
trunk/Include/Classes/System/String.ab
r468 r478 256 256 257 257 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 260 262 End If 261 263 Return False -
trunk/Include/OAIdl.ab
r303 r478 2 2 ' 本来はOAIdl.idlから生成するのが正当ですが、 3 3 ' これは手動で移植したものです。 4 5 #ifndef _INC_OAIDL_AB6 #define _INC_OAIDL_AB7 8 '#ifndef COM_NO_WINDOWS_H9 #require <windows.sbp>10 #require <ole2.ab>11 '#endif /*COM_NO_WINDOWS_H*/12 4 13 5 #require <objidl.sbp> … … 777 769 778 770 Type /* [wire_marshal] */ CLEANLOCALSTORAGE 779 pInterface As *IUnknown771 pInterface As IUnknown 780 772 pStorage As VoidPtr 781 773 flags As DWord … … 823 815 /* [in] */ wMinorVerNum As Word) As HRESULT 824 816 Function AddRefTypeInfo( 825 /* [in] */ pTInfo As *ITypeInfo,817 /* [in] */ TInfo As ITypeInfo, 826 818 /* [in] */ByRef hRefType As HREFTYPE) As HRESULT 827 819 Function AddFuncDesc( … … 1037 1029 /* [in] */ iTInfo As DWord, 1038 1030 /* [in] */ lcid As LCID, 1039 /* [out] */ ByRef pTInfo As *ITypeInfo) As HRESULT1031 /* [out] */ ByRef TInfo As ITypeInfo) As HRESULT 1040 1032 Function GetIDsOfNames( 1041 1033 /* [in] */ ByRef riid As IID, … … 1078 1070 Function Reset() As HRESULT 1079 1071 Function Clone( 1080 /* [out] */ ByRef pEnum As *IEnumVARIANT) As HRESULT1072 /* [out] */ ByRef enum_ As IEnumVARIANT) As HRESULT 1081 1073 1082 1074 End Interface … … 1105 1097 lpfuncdesc As *FUNCDESC 1106 1098 lpvardesc As *VARDESC 1107 lptcomp As *ITypeComp1099 lptcomp As ITypeComp 1108 1100 End Union 1109 1101 */ … … 1123 1115 /* [in] */ HashVal As DWord, 1124 1116 /* [in] */ wFlags As Word, 1125 /* [out] */ ByRef pTInfo As *ITypeInfo,1117 /* [out] */ ByRef TInfo As ITypeInfo, 1126 1118 /* [out] */ ByRef DescKind As DESCKIND, 1127 1119 /* [out] */ ByRef BindPtr As BINDPTR) As HRESULT … … 1130 1122 /* [in] */ szName As LPOLESTR, 1131 1123 /* [in] */ HashVal As DWord, 1132 /* [out] */ ByRef pTInfo As *ITypeInfo,1133 /* [out] */ ByRef pTComp As *ITypeComp) As HRESULT1124 /* [out] */ ByRef TInfo As ITypeInfo, 1125 /* [out] */ ByRef TComp As ITypeComp) As HRESULT 1134 1126 End Interface 1135 1127 … … 1333 1325 Function GetTypeInfo( 1334 1326 /* [in] */ index As DWord, 1335 /* [out] */ ByRef pTInfo As *ITypeInfo) As HRESULT1327 /* [out] */ ByRef TInfo As ITypeInfo) As HRESULT 1336 1328 Function GetTypeInfoType( 1337 1329 /* [in] */ index As DWord, … … 1339 1331 Function GetTypeInfoOfGuid( 1340 1332 /* [in] */ ByRef guid As GUID, 1341 /* [out] */ ByRef pTInfo As *ITypeInfo) As HRESULT1333 /* [out] */ ByRef TInfo As ITypeInfo) As HRESULT 1342 1334 Function /* [local] */ GetLibAttr( 1343 /* [out] */ ByRef pTLibAttr As *TLIBATTR) As HRESULT1335 /* [out] */ ByRef TLibAttr As TLIBATTR) As HRESULT 1344 1336 Function GetTypeComp( 1345 /* [out] */ ByRef ppTComp As *ITypeComp) As HRESULT1337 /* [out] */ ByRef TComp As ITypeComp) As HRESULT 1346 1338 Function /* [local] */ GetDocumentation( 1347 1339 /* [in] */ index As Long, … … 1357 1349 /* [out][in] */ szNameBuf As LPOLESTR, 1358 1350 /* [in] */ lHashVal As DWord, 1359 /* [length_is][size_is][out] */ p pTInfo As **ITypeInfo,1351 /* [length_is][size_is][out] */ pTInfo As *ITypeInfo, 1360 1352 /* [length_is][size_is][out] */ rgMemId As *MEMBERID, 1361 1353 /* [out][in] */ ByRef cFound As Word) As HRESULT … … 1425 1417 Function RequestTypeChange( 1426 1418 /* [in] */ changeKind As CHANGEKIND, 1427 /* [in] */ pTInfoBefore As ITypeInfo,1419 /* [in] */ TInfoBefore As ITypeInfo, 1428 1420 /* [in] */ pStrName As LPOLESTR, 1429 1421 /* [out] */ ByRef fCancel As Long) As HRESULT 1430 1422 Function AfterTypeChange( 1431 1423 /* [in] */ changeKind As CHANGEKIND, 1432 /* [in] */ pTInfoAfter As *ITypeInfo,1424 /* [in] */ TInfoAfter As ITypeInfo, 1433 1425 /* [in] */ pStrName As LPOLESTR) As HRESULT 1434 1426 End Interface … … 1525 1517 1526 1518 Function CreateFromTypeInfo( 1527 /* [in] */ pTypeInfo As *ITypeInfo,1519 /* [in] */ TypeInfo As ITypeInfo, 1528 1520 /* [in] */ ByRef riid As IID, 1529 /* [iid_is][out] */ ByRef pv As *IUnknown) As HRESULT1521 /* [iid_is][out] */ ByRef pv As IUnknown) As HRESULT 1530 1522 End Interface 1531 1523 … … 1620 1612 /* [length_is][size_is][out] */ rgBstrNames As *BSTR) As HRESULT 1621 1613 Function IsMatchingType( 1622 /* [in] */ pRecordInfo As *IRecordInfo) As BOOL1614 /* [in] */ RecordInfo As IRecordInfo) As BOOL 1623 1615 Function RecordCreate() As VoidPtr 1624 1616 Function RecordCreateCopy( … … 1678 1670 #endif /* __IPropertyBag_INTERFACE_DEFINED__ */ 1679 1671 1680 #endif '_INC_OAIDL_AB -
trunk/Include/api_imm.sbp
r300 r478 1 1 ' api_imm.sbp 2 3 #ifndef _IMM_4 #define _IMM_5 6 #ifndef _IMM_SDK_DEFINED_7 #define _IMM_SDK_DEFINED_8 2 9 3 Type _System_DeclareHandle_HIMC:unused As DWord:End Type … … 702 696 ' for Windows Simplified Chinese Edition 703 697 Const SOFTKEYBOARD_TYPE_C1 = &h0002 704 705 #endif '_IMM_SDK_DEFINED_706 707 #endif '_IMM_ -
trunk/Include/basic/command.sbp
r457 r478 4 4 #ifndef _INC_COMMAND 5 5 #define _INC_COMMAND 6 7 #require <windows.sbp>8 #require <Classes/System/Environment.ab>9 #require <Classes/ActiveBasic/Windows/Windows.ab>10 6 11 7 Const _System_Type_SByte = 1 … … 67 63 68 64 Macro 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) Then71 retAns = ret72 End If65 ' Dim ret = MessageBox(hwnd, ToTCStr(str), ToTCStr(title), boxType) 66 ' If VarPtr(retAns) Then 67 ' retAns = ret 68 ' End If 73 69 End Macro 74 70 -
trunk/Include/com/bstring.ab
r335 r478 1 1 ' com/bstring.ab 2 3 '#require <ole2.ab>4 '#require <oleauto.ab>5 2 6 3 Namespace ActiveBasic … … 8 5 9 6 Class BString 10 'Inherits System.IDisposable, System.ICloneable7 Implements System.IDisposable ', System.ICloneable 11 8 Public 12 9 Sub BString() … … 19 16 20 17 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 26 21 End Sub 27 22 28 23 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 40 27 End Sub 41 28 42 29 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 45 66 46 67 Sub ~BString() … … 48 69 End Sub 49 70 50 Sub Assign(bstr As BString)51 Clear()52 BString.Copy(This.bs, bstr.bs)53 End Sub54 55 Sub Assign(s As LPCOLESTR)56 Clear()57 s = SysAllocString(s)58 End Sub59 60 Sub AssignFromBStr(bstr As BSTR)61 Clear()62 BString.Copy(bs, bstr)63 End Sub64 65 71 Const Function Copy() As BSTR 66 BString.Copy(Copy,bs)72 Copy = copy(bs) 67 73 End Function 68 74 … … 76 82 77 83 Sub Clear() 78 If bs <> 0 Then 79 SysFreeString(bs) 80 bs = 0 81 End If 84 reset(0) 82 85 End Sub 83 86 84 87 Sub Attach(ByRef bstr As BSTR) 85 Clear() 86 BString.Move(bs, bstr) 88 reset(move(bstr)) 87 89 End Sub 88 90 89 91 Function Detach() As BSTR 90 BString.Move(Detach,bs)92 Detach = move(bs) 91 93 End Function 92 94 93 95 Function BStr() As BSTR 94 96 BStr = bs 95 End Function96 /*97 Static Function Assgin(bs As BSTR) As BString98 Assgin = New BString99 Assgin.Assgin(bs)100 97 End Function 101 98 … … 104 101 Attach.Attach(bs) 105 102 End Function 106 */ 103 107 104 Const Function Length() As DWord 108 Length = SysStringLen(bs)105 Length = GetDWord(bs As VoidPtr - SizeOf (DWord)) 'SysStringLen(bs) 109 106 End Function 110 107 111 108 Const Function Operator [](i As SIZE_T) As OLECHAR 112 #ifdef _DEBUG113 109 If i > Length Then 114 'Throw OutOfRangeException 115 End If 116 #endif 110 Throw New ArgumentOutOfRangeException("i") 111 End If 117 112 Return bs[i] 118 113 End Function 119 114 120 115 Sub Operator []=(i As SIZE_T, c As OLECHAR) 121 #ifdef _DEBUG122 116 If i > Length Then 123 'Throw OutOfRangeException 124 End If 125 #endif 117 Throw New ArgumentOutOfRangeException("i") 118 End If 126 119 bs[i] = c 127 120 End Sub … … 135 128 End Function 136 129 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 137 194 Private 138 195 bs As BSTR 139 196 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 154 219 End Class 155 220 -
trunk/Include/com/currency.ab
r355 r478 2 2 3 3 #require <com/variant.ab> 4 5 #ifndef _COM_CURRENCY_AB6 #define _COM_CURRENCY_AB7 4 8 5 Namespace ActiveBasic … … 56 53 Return ret 57 54 End Function 58 /* 55 59 56 Const Function Operator /(y As Variant) As Double 60 57 Dim vx = New Variant(This) … … 69 66 Return ret.ValR8 70 67 End Function 71 */ 68 72 69 Const Function Operator +(y As Currency) As Currency 73 70 Dim ret = New Currency … … 131 128 Return c = VARCMP_LT 132 129 End Function 133 /* 130 134 131 Const Function Operator >(y As Currency) As Boolean 135 132 Dim c = Compare(This, y) … … 141 138 Return c = VARCMP_GT 142 139 End Function 143 */ 140 144 141 Const Function Operator <=(y As Currency) As Boolean 145 142 Dim c = Compare(This, y) … … 183 180 184 181 Const Function Cy() As CY 185 Returncy182 Cy = cy 186 183 End Function 187 184 … … 203 200 204 201 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 209 208 End Function 210 209 … … 223 222 End Namespace 'COM 224 223 End Namespace 'ActiveBasic 225 226 #endif '_COM_CURRENCY_AB -
trunk/Include/com/decimal.ab
r355 r478 1 1 ' com/decimal.ab 2 2 3 '#require <oleauto.ab>4 3 #require <com/variant.ab> 5 4 #require <com/currency.ab> … … 14 13 15 14 Sub Decimal(d As Decimal) 16 ' dec = d なぜかコンパイルできない 17 memcpy(VarPtr(dec), VarPtr(d.dec), Len(dec)) 15 dec = d.dec 18 16 End Sub 19 17 20 18 Sub Decimal(ByRef d As DECIMAL) 21 memcpy(VarPtr(dec), VarPtr(d), Len(dec))19 dec = d 22 20 End Sub 23 21 24 22 Sub Decimal(lo As Long, mid As Long, hi As Long, isNegative As Boolean, scale As Byte) 25 23 If scale > 28 Then 26 Debug 27 Throw New ArgumentOutOfRangeException 24 Throw New ArgumentOutOfRangeException("scale") 28 25 End If 29 26 Dim sign As Byte … … 284 281 Return c = VARCMP_LT 285 282 End Function 286 /* 283 287 284 Const Function Operator >(y As Decimal) As Boolean 288 285 Dim c = Compare(This, y) … … 294 291 Return c = VARCMP_GT 295 292 End Function 296 */ 293 297 294 Const Function Operator <=(y As Decimal) As Boolean 298 295 Dim c = Compare(This, y) … … 348 345 349 346 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 354 353 End Function 355 354 -
trunk/Include/com/variant.ab
r355 r478 1 1 ' com/variant.ab 2 2 3 #ifndef _COM_VARIANT_AB4 #define _COM_VARIANT_AB5 6 '#require <oaidl.ab>7 '#require <oleauto.ab>8 3 '#require <com/index.ab> 9 4 … … 79 74 Sub Variant(bs As BString) 80 75 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() 86 81 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() 92 87 v.vt = VT_DISPATCH 93 SetPointer(VarPtr(v.val), p)88 SetPointer(VarPtr(v.val), ObjPtr(disp)) 94 89 End Sub 95 90 /* … … 284 279 285 280 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) 287 282 End Function 288 283 … … 290 285 Return VarCmp(x.v, y.v, LOCALE_USER_DEFAULT, 0) 'VARCMP_NULL = 3を返す場合があるので注意 291 286 End Function 292 /* 287 293 288 Const Function Operator ==(y As Variant) As Boolean 294 289 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 300 291 End Function 301 292 302 293 Const Function Operator <>(y As Variant) As Boolean 303 294 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 309 296 End Function 310 297 311 298 Const Function Operator <(y As Variant) As Boolean 312 299 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 320 303 Const Function Operator >(y As Variant) As Boolean 321 304 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 330 308 Const Function Operator <=(y As Variant) As Boolean 331 309 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 337 311 End Function 338 312 339 313 Const Function Operator >=(y As Variant) As Boolean 340 314 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 348 318 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) 352 321 End Function 353 322 … … 369 338 370 339 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 374 343 End Function 375 344 … … 526 495 527 496 Const Function ValStr() As BString 497 ValStr = New BString 528 498 Dim r As VARIANT 529 499 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) 533 501 End Function 534 502 … … 536 504 Clear() 537 505 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 542 514 Dim r As VARIANT 543 515 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 551 525 v.vt = VT_UNKNOWN 552 526 End Sub … … 587 561 588 562 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 595 579 End Function 596 580 Private … … 605 589 ' src.vt = VT_EMPTY 606 590 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 607 602 End Class 608 609 Dim VariantOptionalParam = Nothing As Variant610 603 611 604 /* … … 629 622 End Namespace 'COM 630 623 End Namespace 'ActiveBasic 631 632 #endif '_COM_VARIANT_AB -
trunk/Include/objidl.sbp
r411 r478 160 160 End Type 161 161 162 Dim IID_IMultiQI = [&h00000020, &h0000, &h0000, [&hC0, &h00, &h00, &h00, &h00, &h00, &h00, &h46]] As IID162 Dim IID_IMultiQI = [&h00000020, 0, 0, [&hC0, 0, 0, 0, 0, 0, 0, &h46]] As IID 163 163 Interface IMultiQI 164 164 Inherits IUnknown … … 169 169 End Interface 170 170 171 ' AsyncIMultiQI 172 173 ' IInternalUnknown 171 /* interface AsyncIMultiQI */ 172 /* [uuid][local][object] */ 173 174 175 Dim IID_AsyncIMultiQI = [&h000e0020, 0, 0, [&hC0, 0, 0, 0, 0, 0, 0, &h46]] As IID 176 Interface 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 184 End Interface 185 186 /* interface IInternalUnknown */ 187 /* [uuid][local][object] */ 188 Dim IID_IInternalUnknown = [&h00000021, 0, 0, [&hC0, 0, 0, 0, 0, 0, 0, &h46]] As IID 189 Interface IInternalUnknown 190 Inherits IUnknown 191 192 Function QueryInternalInterface( 193 /* [in] */ ByRef riid As IID, 194 /* [out] */ ByRef ppv As Any) As HRESULT 195 End Interface 174 196 175 197 /* interface IEnumUnknown */ … … 180 202 Inherits IUnknown 181 203 182 /* [local] */ Function Next _(204 /* [local] */ Function Next( 183 205 /* [in] */ celt As DWord, 184 206 /* [out] */ rgelt As *IUnknown, … … 307 329 End Interface 308 330 309 Dim IID_IPersist = [&h0000010c, &h0000, &h0000, [&hC0, &h00, &h00, &h00, &h00, &h00, &h00, &h46]] As IID331 Dim IID_IPersist = [&h0000010c, 0, 0, [&hC0, 0, 0, 0, 0, 0, 0, &h46]] As IID 310 332 Interface IPersist 311 333 Inherits IUnknown … … 315 337 End Interface 316 338 317 Dim IID_IPersistStream = [&h00000109, &h0000, &h0000, [&hC0, &h00, &h00, &h00, &h00, &h00, &h00, &h46]] As IID339 Dim IID_IPersistStream = [&h00000109, 0, 0, [&hC0, 0, 0, 0, 0, 0, 0, &h46]] As IID 318 340 Interface IPersistStream 319 341 Inherits IPersist … … 484 506 End Enum 485 507 486 Dim IID_IStream = [&h0000000c, &h0000, &h0000, [&hC0, &h00, &h00, &h00, &h00, &h00, &h00, &h46]] As IID508 Dim IID_IStream = [&h0000000c, 0, 0, [&hC0, 0, 0, 0, 0, 0, 0, &h46]] As IID 487 509 Interface IStream 488 510 Inherits ISequentialStream … … 552 574 TypeDef SNB = /* [wire_marshal] */ **OLECHAR 553 575 554 Dim IID_IStorage = [&h0000000b, &h0000, &h0000, [&hC0, &h00, &h00, &h00, &h00, &h00, &h00, &h46]] As IID576 Dim IID_IStorage = [&h0000000b, 0, 0, [&hC0, 0, 0, 0, 0, 0, 0, &h46]] As IID 555 577 Interface IStorage 556 578 Inherits IUnknown … … 905 927 TypeDef LPINTERFACEINFO = *INTERFACEINFO 906 928 907 Dim IID_IMessageFilter = [&h00000016, &h0000, &h0000, [&hC0, &h00, &h00, &h00, &h00, &h00, &h00, &h46]] As IID929 Dim IID_IMessageFilter = [&h00000016, 0, 0, [&hC0, 0, 0, 0, 0, 0, 0, &h46]] As IID 908 930 Interface IMessageFilter 909 931 Inherits IUnknown … … 966 988 ' ISurrogate 967 989 968 ' IGlobalInterfaceTable 990 Dim IID_IGlobalInterfaceTable = [&h00000146, 0, 0, [&hC0, 0, 0, 0, 0, 0, 0, &h46]] As IID 991 Interface 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 1004 End Interface 969 1005 970 1006 ' IDirectWriterLock -
trunk/Include/ole2.ab
r303 r478 8 8 #require <objbase.sbp> 9 9 #require <oleauto.ab> 10 10 #ifdef __UNDEFINED '#165が解決するまでの暫定 11 11 ' View OBJECT Error Codes 12 12 … … 56 56 57 57 /* helper functions */ 58 Declare Function ReadClassStg Lib "ole32.dll" (/*IN*/ ByVal pStg As *IStorage, /*OUT*/ ByRef clsid As CLSID) As HRESULT59 Declare Function WriteClassStg Lib "ole32.dll" (/*IN*/ ByVal pStg As *IStorage, /*IN*/ ByRef clsid As CLSID) As HRESULT60 Declare Function ReadClassStm Lib "ole32.dll" (/*IN*/ ByVal pStm As *IStream, /*OUT*/ ByRef clsid As CLSID) As HRESULT61 Declare Function WriteClassStm Lib "ole32.dll" (/*IN*/ ByVal pStm As *IStream, /*IN*/ ByRef clsid As CLSID) As HRESULT62 Declare Function WriteFmtUserTypeStg Lib "ole32.dll" (/*IN*/ ByVal pstg As *IStorage, /*IN*/ ByVal cf As CLIPFORMAT, /*IN*/ ByVal pszUserType As *OLECHAR) As HRESULT63 Declare Function ReadFmtUserTypeStg Lib "ole32.dll" (/*IN*/ ByVal pstg As *IStorage, /*OUT*/ ByRef cf As CLIPFORMAT, /*OUT*/ ByRef rpszUserType As *OLECHAR) As HRESULT58 Declare Function ReadClassStg Lib "ole32.dll" (/*IN*/ ByVal stg As IStorage, /*OUT*/ ByRef clsid As CLSID) As HRESULT 59 Declare Function WriteClassStg Lib "ole32.dll" (/*IN*/ ByVal stg As IStorage, /*IN*/ ByRef clsid As CLSID) As HRESULT 60 Declare Function ReadClassStm Lib "ole32.dll" (/*IN*/ ByVal stm As IStream, /*OUT*/ ByRef clsid As CLSID) As HRESULT 61 Declare Function WriteClassStm Lib "ole32.dll" (/*IN*/ ByVal stm As IStream, /*IN*/ ByRef clsid As CLSID) As HRESULT 62 Declare Function WriteFmtUserTypeStg Lib "ole32.dll" (/*IN*/ ByVal stg As IStorage, /*IN*/ ByVal cf As CLIPFORMAT, /*IN*/ ByVal pszUserType As *OLECHAR) As HRESULT 63 Declare Function ReadFmtUserTypeStg Lib "ole32.dll" (/*IN*/ ByVal stg As IStorage, /*OUT*/ ByRef cf As CLIPFORMAT, /*OUT*/ ByRef rpszUserType As *OLECHAR) As HRESULT 64 64 65 65 … … 73 73 the data object */ 74 74 75 Declare Function OleQueryLinkFromData Lib "ole32" (/*IN*/ ByVal pSrcDataObject As *IDataObject) As HRESULT76 Declare Function OleQueryCreateFromData Lib "ole32.dll" (/*IN*/ ByVal pSrcDataObject As *IDataObject) As HRESULT75 Declare Function OleQueryLinkFromData Lib "ole32" (/*IN*/ ByVal srcDataObject As IDataObject) As HRESULT 76 Declare Function OleQueryCreateFromData Lib "ole32.dll" (/*IN*/ ByVal srcDataObject As IDataObject) As HRESULT 77 77 78 78 79 79 /* Object creation APIs */ 80 80 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 HRESULT81 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 clientSite As IOleClientSite, 83 /*IN*/ ByVal stg As IStorage, /*OUT*/ ByRef ppvObj As Any) As HRESULT 84 84 85 85 Declare Function OleCreateEx Lib "ole32.dll" (/*IN*/ ByRef rclsid As CLSID, /*IN*/ ByRef riid As IID, /*IN*/ ByVal dwFlags As DWord, 86 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 HRESULT90 91 Declare Function OleCreateFromData Lib "ole32.dll" (/*IN*/ ByVal pSrcDataObj As *IDataObject, /*IN*/ ByRef riid As IID,92 93 /*IN*/ ByVal pClientSite As *IOleClientSite, /*IN*/ ByVal pStg As *IStorage,94 95 96 Declare Function OleCreateFromDataEx Lib "ole32.dll" (/*IN*/ ByVal pSrcDataObj As *IDataObject, /*IN*/ ByRef riid As IID,97 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 HRESULT101 102 Declare Function OleCreateLinkFromData Lib "ole32.dll" (/*IN*/ ByVal pSrcDataObj As *IDataObject, /*IN*/ ByRef riid As IID,103 104 /*IN*/ ByVal pClientSite As *IOleClientSite, /*IN*/ ByVal pStg As *IStorage,105 106 107 Declare Function OleCreateLinkFromDataEx Lib "ole32.dll" (/*IN*/ ByVal pSrcDataObj As *IDataObject, /*IN*/ ByRef riid As IID,108 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 HRESULT112 113 Declare Function OleCreateStaticFromData Lib "ole32.dll" (/*IN*/ ByVal pSrcDataObj As *IDataObject, /*IN*/ ByRef riid As IID,114 115 /*IN*/ ByVal pClientSite As *IOleClientSite, /*IN*/ ByVal pStg As *IStorage,116 117 118 119 Declare Function OleCreateLink Lib "ole32.dll" (/*IN*/ ByVal pmkLinkSrc As *IMoniker, /*IN*/ ByRef riid As IID,120 121 /*IN*/ ByVal pClientSite As *IOleClientSite, /*IN*/ ByVal pDataObj As *IDataObject, /*OUT*/ ByRef ppvObj As Any) As HRESULT122 123 Declare Function OleCreateLinkEx Lib "ole32.dll" (/*IN*/ ByVal pmkLinkSrc As *IMoniker, /*IN*/ ByRef riid As IID,124 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 HRESULT86 /*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 91 Declare 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 96 Declare 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 102 Declare 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 107 Declare 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 113 Declare 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 119 Declare 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 123 Declare 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 128 128 129 129 Declare Function OleCreateLinkToFile Lib "ole32.dll" (/*IN*/ ByVal lpszFileName As LPCOLESTR, /*IN*/ ByRef riid As IID, 130 131 /*IN*/ ByVal pClientSite As *IOleClientSite, /*IN*/ ByVal pDataObj As *IDataObject, /*OUT*/ ByRef ppvObj As Any) As HRESULT130 /*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 132 132 133 133 Declare Function OleCreateLinkToFileEx Lib "ole32.dll" (/*IN*/ ByVal lpszFileName As LPCOLESTR, /*IN*/ ByRef riid As IID, 134 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 HRESULT134 /*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 138 138 139 139 Declare Function OleCreateFromFile Lib "ole32.dll" (/*IN*/ ByRef rclsid As CLSID, /*IN*/ ByVal lpszFileName As LPOLESTR, /*IN*/ ByRef riid As IID, 140 141 /*IN*/ ByVal pClientSite As *IOleClientSite, /*IN*/ ByVal pDataObj As *IDataObject, /*OUT*/ ByRef ppvObj As Any) As HRESULT140 /*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 142 142 143 143 Declare Function OleCreateFromFileEx Lib "ole32.dll" (/*IN*/ ByRef rclsid As CLSID, /*IN*/ ByVal lpszFileName As LPOLESTR, /*IN*/ ByRef riid As IID, 144 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 HRESULT148 149 Declare Function OleLoad Lib "ole32.dll" (/*IN*/ ByVal pStg As *IStorage, /*IN*/ ByRef riid As IID, /*IN*/ ByVal pClientSite As *IOleClientSite,150 151 152 Declare Function OleSave Lib "ole32.dll" (/*IN*/ ByVal p PS As *IPersistStorage, /*IN*/ ByVal pStg As *IStorage, /*IN*/ fSameAsLoad As BOOL) As HRESULT153 154 Declare Function OleLoadFromStream Lib "ole32.dll" ( /*IN*/ ByVal pStm As *IStream, /*IN*/ ByRef iidInterface As IID, /*OUT*/ ByRef ppvObj As Any) As HRESULT155 Declare Function OleSaveToStream Lib "ole32.dll" ( /*IN*/ ByVal p PStm As *IPersistStream, /*IN*/ ByVal pStm As *IStream) As HRESULT156 157 158 Declare Function OleSetContainedObject Lib "ole32.dll" (/*IN*/ ByVal pUnknown As *IUnknown, /*IN*/ ByVal fContained As BOOL) As HRESULT159 Declare Function OleNoteObjectVisible Lib "ole32.dll" (/*IN*/ ByVal pUnknown As *IUnknown, /*IN*/ ByVal fContained As BOOL) As HRESULT144 /*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 149 Declare 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 152 Declare Function OleSave Lib "ole32.dll" (/*IN*/ ByVal ps As IPersistStorage, /*IN*/ ByVal stg As IStorage, /*IN*/ fSameAsLoad As BOOL) As HRESULT 153 154 Declare Function OleLoadFromStream Lib "ole32.dll" ( /*IN*/ ByVal stm As IStream, /*IN*/ ByRef iidInterface As IID, /*OUT*/ ByRef ppvObj As Any) As HRESULT 155 Declare Function OleSaveToStream Lib "ole32.dll" ( /*IN*/ ByVal pstm As IPersistStream, /*IN*/ ByVal stm As IStream) As HRESULT 156 157 158 Declare Function OleSetContainedObject Lib "ole32.dll" (/*IN*/ ByVal unknown As IUnknown, /*IN*/ ByVal fContained As BOOL) As HRESULT 159 Declare Function OleNoteObjectVisible Lib "ole32.dll" (/*IN*/ ByVal unknown As IUnknown, /*IN*/ ByVal fContained As BOOL) As HRESULT 160 160 161 161 162 162 /* Drag/Drop APIs */ 163 163 164 Declare Function RegisterDragDrop Lib "ole32.dll" (/*IN*/ ByVal hwnd As HWND, /*IN*/ ByVal pDropTarget As *IDropTarget) As HRESULT164 Declare Function RegisterDragDrop Lib "ole32.dll" (/*IN*/ ByVal hwnd As HWND, /*IN*/ ByVal dropTarget As IDropTarget) As HRESULT 165 165 Declare 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 166 Declare 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 168 168 169 169 /* Clipboard APIs */ 170 170 171 Declare Function OleSetClipboard Lib "ole32.dll" (/*IN*/ ByVal pDataObj As *IDataObject) As HRESULT172 Declare Function OleGetClipboard Lib "ole32.dll" (/*OUT*/ ByRef pDataObj As *IDataObject) As HRESULT171 Declare Function OleSetClipboard Lib "ole32.dll" (/*IN*/ ByVal dataObj As IDataObject) As HRESULT 172 Declare Function OleGetClipboard Lib "ole32.dll" (/*OUT*/ ByRef dataObj As IDataObject) As HRESULT 173 173 Declare Function OleFlushClipboard Lib "ole32.dll" () As HRESULT 174 Declare Function OleIsCurrentClipboard Lib "ole32.dll" (/*IN*/ ByVal pDataObj As *IDataObject) As HRESULT174 Declare Function OleIsCurrentClipboard Lib "ole32.dll" (/*IN*/ ByVal dataObj As IDataObject) As HRESULT 175 175 176 176 … … 189 189 End Type 190 190 Declare Function OleCreateMenuDescriptor Lib "ole32.dll" (/*IN*/ ByVal hmenuCombined As HMENU, 191 191 /*IN*/ ByRef MenuWidths As OLEMENUGROUPWIDTHS) As HOLEMENU 192 192 Declare Function OleSetMenuDescriptor Lib "ole32.dll" (/*IN*/ ByVal holemenu As HOLEMENU, /*IN*/ ByVal hwndFrame As HWND, 193 194 /*IN*/ ByVal pFrame As *IOleInPlaceFrame,195 /*IN*/ ByVal pActiveObj As *IOleInPlaceActiveObject) As HRESULT193 /*IN*/ ByVal hwndActiveObject As HWND, 194 /*IN*/ ByVal frame As IOleInPlaceFrame, 195 /*IN*/ ByVal activeObj As IOleInPlaceActiveObject) As HRESULT 196 196 Declare Function OleDestroyMenuDescriptor Lib "ole32.dll" (/*IN*/ ByVal holemenu As HOLEMENU) As HRESULT 197 197 198 Declare Function OleTranslateAccelerator Lib "ole32.dll" (/*IN*/ ByVal pFrame As *IOleInPlaceFrame,199 198 Declare Function OleTranslateAccelerator Lib "ole32.dll" (/*IN*/ ByVal frame As IOleInPlaceFrame, 199 /*IN*/ ByRef FrameInfo As OLEINPLACEFRAMEINFO, /*IN*/ ByRef msg As MSG) As HRESULT 200 200 201 201 202 202 /* Helper APIs */ 203 203 Declare Function OleDuplicateData Lib "ole32.dll" (/*IN*/ ByVal hSrc As HANDLE, /*IN*/ ByVal cfFormat As CLIPFORMAT, 204 205 206 Declare Function OleDraw Lib "ole32.dll" (/*IN*/ ByVal pUnknown As *IUnknown, /*IN*/ ByVal dwAspect As DWord, /*IN*/ ByVal hdcDraw As HDC,207 208 209 Declare Function OleRun Lib "ole32.dll" (/*IN*/ ByVal pUnknown As *IUnknown) As HRESULT210 Declare Function OleIsRunning Lib "ole32.dll" (/*IN*/ ByVal pObject As *IOleObject) As BOOL211 Declare Function OleLockRunning Lib "ole32.dll" (/*IN*/ ByVal pUnknown As *IUnknown, /*IN*/ ByVal fLock As BOOL, /*IN*/ ByVal fLastUnlockCloses As BOOL) As HRESULT204 /*IN*/ ByVal uiFlags As DWord) As HANDLE 205 206 Declare 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 209 Declare Function OleRun Lib "ole32.dll" (/*IN*/ ByVal unknown As IUnknown) As HRESULT 210 Declare Function OleIsRunning Lib "ole32.dll" (/*IN*/ ByVal object As IOleObject) As BOOL 211 Declare Function OleLockRunning Lib "ole32.dll" (/*IN*/ ByVal unknown As IUnknown, /*IN*/ ByVal fLock As BOOL, /*IN*/ ByVal fLastUnlockCloses As BOOL) As HRESULT 212 212 Declare Sub ReleaseStgMedium Lib "ole32.dll" (/*IN*/ ByRef medium As STGMEDIUM) 213 Declare Function CreateOleAdviseHolder Lib "ole32.dll" (/*OUT*/ ByRef pOAHolder As *IOleAdviseHolder) As HRESULT214 215 Declare Function OleCreateDefaultHandler Lib "ole32.dll" (/*IN*/ ByRef clsid As CLSID, /*IN*/ ByVal pUnkOuter As *IUnknown,216 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 213 Declare Function CreateOleAdviseHolder Lib "ole32.dll" (/*OUT*/ ByRef oaHolder As IOleAdviseHolder) As HRESULT 214 215 Declare 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 218 Declare 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 221 221 222 222 Declare Function IsAccelerator Lib "ole32.dll" (/*IN*/ ByVal hAccel As HACCEL, /*IN*/ ByVal cAccelEntries As Long, /*IN*/ ByRef msg As MSG, 223 223 /*OUT*/ ByVal pwCmd As *Word) As BOOL 224 224 /* Icon extraction Helper APIs */ 225 225 … … 227 227 228 228 Declare Function OleGetIconOfClass Lib "ole32.dll" (/*IN*/ ByRef rclsid As CLSID, /*IN*/ ByVal lpszLabel As LPOLESTR, 229 229 /*IN*/ ByVal fUseTypeAsLabel As BOOL) As HGLOBAL 230 230 231 231 Declare Function OleMetafilePictFromIconAndLabel Lib "ole32.dll" (/*IN*/ ByVal hIcon As HICON, /*IN*/ ByVal lpszLabel As LPOLESTR, 232 232 /*IN*/ ByVal lpszSourceFile As LPOLESTR, /*IN*/ ByVal iIconIndex As DWord) As HGLOBAL 233 233 234 234 … … 237 237 238 238 Declare Function OleRegGetUserType Lib "ole32.dll" (/*IN*/ ByRef rclsid As CLSID, /*IN*/ ByVal dwFormOfType As DWord, 239 239 /*OUT*/ ByVal pszUserType As LPOLESTR) As HRESULT 240 240 241 241 Declare Function OleRegGetMiscStatus Lib "ole32.dll" (/*IN*/ ByRef rclsid As CLSID, /*IN*/ ByVal dwAspect As DWord, 242 242 /*OUT*/ ByRef dwStatus As DWord) As HRESULT 243 243 244 244 Declare Function OleRegEnumFormatEtc Lib "ole32.dll" (/*IN*/ ByRef rclsid As CLSID, /*IN*/ ByVal dwDirection As DWord, 245 245 /*OUT*/ ByRef penum As *IEnumFORMATETC) As HRESULT 246 246 247 247 Declare Function OleRegEnumVerbs Lib "ole32.dll" (/*IN*/ ByRef rclsid As CLSID, /*OUT*/ ByRef penum As *IEnumOLEVERB) As HRESULT … … 259 259 260 260 261 Declare Function OleConvertOLESTREAMToIStorage Lib "ole32.dll" ( _262 263 /*OUT*/ ByVal pstg As *IStorage,264 265 266 Declare Function OleConvertIStorageToOLESTREAM Lib "ole32.dll" ( _267 /*IN*/ ByVal pstg As *IStorage,268 261 Declare 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 266 Declare Function OleConvertIStorageToOLESTREAM Lib "ole32.dll" ( 267 /*IN*/ ByVal stg As IStorage, 268 /*OUT*/ ByVal lpolestream As LPOLESTREAM) As HRESULT 269 269 270 270 … … 272 272 Declare Function GetHGlobalFromILockBytes Lib "ole32.dll" (/*IN*/ ByVal plkbyt As *ILockBytes, /*OUT*/ ByRef hglobal As HGLOBAL) As HRESULT 273 273 Declare Function CreateILockBytesOnHGlobal Lib "ole32.dll" (/*IN*/ ByVal hGlobal As HGLOBAL, /*IN*/ ByVal fDeleteOnRelease As BOOL, 274 /*OUT*/ ByRef pplkbyt As *ILockBytes) As HRESULT274 /*OUT*/ ByRef lkbyt As ILockBytes) As HRESULT 275 275 276 276 Declare Function GetHGlobalFromStream Lib "ole32.dll" (/*IN*/ ByVal pstm As *IStream, /*OUT*/ ByRef hglobal As HGLOBAL) As HRESULT 277 277 Declare Function CreateStreamOnHGlobal Lib "ole32.dll" (/*IN*/ ByVal hGlobal As HGLOBAL, /*IN*/ ByVal fDeleteOnRelease As BOOL, 278 /*OUT*/ ByRef pstm As *IStream) As HRESULT278 /*OUT*/ ByRef stm As IStream) As HRESULT 279 279 280 280 281 281 /* ConvertTo APIS */ 282 282 283 Declare Function OleDoAutoConvert Lib "ole32.dll" (/*IN*/ ByRef pStg As *IStorage, /*OUT*/ ByRef ClsidNew As CLSID) As HRESULT283 Declare Function OleDoAutoConvert Lib "ole32.dll" (/*IN*/ ByRef stg As IStorage, /*OUT*/ ByRef ClsidNew As CLSID) As HRESULT 284 284 Declare Function OleGetAutoConvert Lib "ole32.dll" (/*IN*/ ByRef clsidOld As CLSID, /*OUT*/ ByRef ClsidNew As CLSID) As HRESULT 285 285 Declare 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 HRESULT287 Declare Function SetConvertStg Lib "ole32.dll" (/*IN*/ ByVal pStg As *IStorage, /*IN*/ fConvert As BOOL) As HRESULT286 Declare Function GetConvertStg Lib "ole32.dll" (/*IN*/ ByVal stg As IStorage) As HRESULT 287 Declare Function SetConvertStg Lib "ole32.dll" (/*IN*/ ByVal stg As IStorage, /*IN*/ fConvert As BOOL) As HRESULT 288 288 289 289 290 290 Declare Function OleConvertIStorageToOLESTREAMEx Lib "ole32.dll" ( _ 291 /*IN*/ ByVal pstg As *IStorage, ' Presentation data to OLESTREAM292 293 294 295 296 297 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 298 298 299 299 Declare Function OleConvertOLESTREAMToIStorageEx Lib "ole32.dll" ( _ 300 301 302 303 304 305 306 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 307 307 308 308 ' 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 HRESULT310 309 Declare 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 311 311 #endif ' __OLE2_AB__ -
trunk/Include/oleidl.ab
r303 r478 130 130 End Enum 131 131 132 Dim IID_IOleObject = [&h00000112, &h0000, &h0000, [&hC0, &h00, &h00, &h00, &h00, &h00, &h00, &h46]] As IID132 Dim IID_IOleObject = [&h00000112, 0, 0, [&hC0, 0, 0, 0, 0, 0, 0, &h46]] As IID 133 133 Interface IOleObject 134 134 Inherits IUnknown -
trunk/Include/system/string.sbp
r398 r478 5 5 #define _INC_BASIC_STRING 6 6 7 #require <Classes/System/String.ab> 8 #require <Classes/System/Text/StringBuilder.ab> 9 10 Function StrPtr(s As String) As *StrChar 7 Function StrPtr(s As String) As *Char 11 8 If Not ActiveBasic.IsNothing(s) Then 12 9 StrPtr = s.StrPtr … … 62 59 出力関数: wcs(z)出力GetStr, mbs(z)出力GetStr, 63 60 wcs(z)出力GetStrNT, mbs(z)出力GetStrNT, 64 GetWCStr, GetMBStr, GetTCStr, GetSCStr,65 ToWCStr, ToMBStr, ToTCStr, ToSCStr66 で、5 * 1 2 = 60通り。61 GetWCStr, GetMBStr, GetTCStr, 62 ToWCStr, ToMBStr, ToTCStr, 63 で、5 * 10 = 50通り。 67 64 */ 68 65 … … 261 258 End Function 262 259 263 Function GetSCStr(mbszSrc As PSTR, ByRef ssDst As *StrChar) As SIZE_T264 Return GetStr(mbszSrc, ssDst)265 End Function266 267 Function GetSCStr(mbsSrc As PSTR, len As SIZE_T, ByRef ssDst As *StrChar) As SIZE_T268 Return GetStr(mbsSrc, len, ssDst)269 End Function270 271 Function GetSCStr(wcszSrc As PWSTR, ByRef ssDst As *StrChar) As SIZE_T272 Return GetStr(wcszSrc, ssDst)273 End Function274 275 Function GetSCStr(wcsSrc As PWSTR, len As SIZE_T, ByRef ssDst As *StrChar) As SIZE_T276 Return GetStr(wcsSrc, len, ssDst)277 End Function278 279 Function GetSCStr(strSrc As String, ByRef ssDst As *StrChar) As SIZE_T280 Return GetStr(strSrc.StrPtr, strSrc.Length As SIZE_T, ssDst)281 End Function282 283 260 Function ToWCStr(mbsz As PSTR) As PWSTR 284 261 GetStrNT(mbsz, ToWCStr) … … 339 316 Function ToTCStr(s As String) As PCTSTR 340 317 GetStrNT(s, ToTCStr) 341 End Function342 343 Function ToSCStr(mbsz As PSTR) As *StrChar344 GetStrNT(mbsz, ToSCStr)345 End Function346 347 Function ToSCStr(mbs As PSTR, len As SIZE_T) As *StrChar348 GetStrNT(mbs, len, ToSCStr)349 End Function350 351 Function ToSCStr(wcsz As PWSTR) As *StrChar352 GetStrNT(wcsz, ToSCStr)353 End Function354 355 Function ToSCStr(wcs As PWSTR, len As SIZE_T) As *StrChar356 GetStrNT(wcs, len, ToSCStr)357 End Function358 359 Function ToSCStr(s As String) As *StrChar360 ToSCStr = StrPtr(s)361 318 End Function 362 319
Note:
See TracChangeset
for help on using the changeset viewer.