Changeset 192 for Include


Ignore:
Timestamp:
Mar 28, 2007, 10:29:58 AM (18 years ago)
Author:
イグトランス (egtra)
Message:

Currencyを追加、その他修正

Location:
Include
Files:
1 added
12 edited

Legend:

Unmodified
Added
Removed
  • Include/Classes/System/String.ab

    r183 r192  
    240240        If AllocStringBuffer(textLengthW) <> 0 Then
    241241            MultiByteToWideChar(CP_THREAD_ACP, 0, text, textLengthA, Chars, textLengthW)
     242            Chars[textLengthW] = 0
    242243        End If
    243244#endif
     
    249250        If AllocStringBuffer(textLengthA) <> 0 Then
    250251            WideCharToMultiByte(CP_THREAD_ACP, 0, text, textLengthW, Chars, textLengthA, 0, 0)
     252            Chars[textLengthA] = 0
    251253        End If
    252254#else
     
    466468        memcpy(VarPtr(Remove.Chars[startIndex]), VarPtr(This.Chars[startIndex + count]), SizeOf (StrChar) * (m_Length - startIndex - count))
    467469    End Function
    468 /*
     470
    469471    Static Function IsNullOrEmpty(s As String) As Boolean
    470472        If s <> Nothing Then
     
    475477        Return False
    476478    End Function
    477 */
     479
    478480    Const Function Replace(oldChar As StrChar, newChar As StrChar) As String
    479481        Replace = Copy(This)
  • Include/OAIdl.ab

    r186 r192  
    2121Const VARIANT_FALSE = (0 As VARIANT_BOOL) ' WTypes.ab
    2222TypeDef SCODE = Long
    23 Type /*Class*/ CY ' WTypes.ab
    24 Public
    25     int64 As Int64
     23TypeDef CY = Int64
     24'Type /*Class*/ CY ' WTypes.ab
     25'Public
     26'   int64 As Int64
    2627/*
    2728    Function Lo() As DWord
     
    4142    End Sub
    4243*/
    43 End Type'Class
     44'End Type'Class
    4445
    4546Type /*Class*/ DECIMAL ' WTypes.ab
  • Include/OleAuto.ab

    r150 r192  
    131131' VARTYPE Coercion API
    132132Declare Function VarUI1FromI2 Lib "oleaut32" (sIn As Integer, ByRef bOut As Byte) As HRESULT
    133 Declare Function VarUI1FromI4 Lib "oleaut32" (lIn As LONG, ByRef bOut As Byte) As HRESULT
     133Declare Function VarUI1FromI4 Lib "oleaut32" (lIn As Long, ByRef bOut As Byte) As HRESULT
    134134Declare Function VarUI1FromI8 Lib "oleaut32" (i64In As Int64, ByRef bOut As Byte) As HRESULT
    135135Declare Function VarUI1FromR4 Lib "oleaut32" (fltIn As Single, ByRef bOut As Byte) As HRESULT
     
    140140Declare Function VarUI1FromDisp Lib "oleaut32" (pdispIn As *IDispatch, lcid As LCID, ByRef bOut As Byte) As HRESULT
    141141Declare Function VarUI1FromBool Lib "oleaut32" (boolIn As VARIANT_BOOL, ByRef bOut As Byte) As HRESULT
    142 Declare Function VarUI1FromI1 Lib "oleaut32" (cIn As CHAR, ByRef bOut As Byte) As HRESULT
     142Declare Function VarUI1FromI1 Lib "oleaut32" (cIn As SByte, ByRef bOut As Byte) As HRESULT
    143143Declare Function VarUI1FromUI2 Lib "oleaut32" (uiIn As Word, ByRef bOut As Byte) As HRESULT
    144144Declare Function VarUI1FromUI4 Lib "oleaut32" (ulIn As DWord, ByRef bOut As Byte) As HRESULT
     
    147147
    148148Declare Function VarI2FromUI1 Lib "oleaut32" (bIn As Byte, ByRef sOut As Integer) As HRESULT
    149 Declare Function VarI2FromI4 Lib "oleaut32" (lIn As LONG, ByRef sOut As Integer) As HRESULT
     149Declare Function VarI2FromI4 Lib "oleaut32" (lIn As Long, ByRef sOut As Integer) As HRESULT
    150150Declare Function VarI2FromI8 Lib "oleaut32" (i64In As Int64, ByRef sOut As Integer) As HRESULT
    151151Declare Function VarI2FromR4 Lib "oleaut32" (fltIn As Single, ByRef sOut As Integer) As HRESULT
     
    156156Declare Function VarI2FromDisp Lib "oleaut32" (pdispIn As *IDispatch, lcid As LCID, ByRef sOut As Integer) As HRESULT
    157157Declare Function VarI2FromBool Lib "oleaut32" (boolIn As VARIANT_BOOL, ByRef sOut As Integer) As HRESULT
    158 Declare Function VarI2FromI1 Lib "oleaut32" (cIn As CHAR, ByRef sOut As Integer) As HRESULT
     158Declare Function VarI2FromI1 Lib "oleaut32" (cIn As SByte, ByRef sOut As Integer) As HRESULT
    159159Declare Function VarI2FromUI2 Lib "oleaut32" (uiIn As Word, ByRef sOut As Integer) As HRESULT
    160160Declare Function VarI2FromUI4 Lib "oleaut32" (ulIn As DWord, ByRef sOut As Integer) As HRESULT
     
    172172Declare Function VarI4FromDisp Lib "oleaut32" (pdispIn As *IDispatch, lcid As LCID, ByRef lOut As Long) As HRESULT
    173173Declare Function VarI4FromBool Lib "oleaut32" (boolIn As VARIANT_BOOL, ByRef lOut As Long) As HRESULT
    174 Declare Function VarI4FromI1 Lib "oleaut32" (cIn As CHAR, ByRef lOut As Long) As HRESULT
     174Declare Function VarI4FromI1 Lib "oleaut32" (cIn As SByte, ByRef lOut As Long) As HRESULT
    175175Declare Function VarI4FromUI2 Lib "oleaut32" (uiIn As Word, ByRef lOut As Long) As HRESULT
    176176Declare Function VarI4FromUI4 Lib "oleaut32" (ulIn As DWord, ByRef lOut As Long) As HRESULT
     
    180180Declare Function VarI8FromUI1 Lib "oleaut32" (bIn As Byte, ByRef i64Out As Int64) As HRESULT
    181181Declare Function VarI8FromI2 Lib "oleaut32" (sIn As Integer, ByRef i64Out As Int64) As HRESULT
    182 Declare Function VarI8FromI4 Lib "oleaut32" (lIn As LONG, ByRef i64Out As Int64) As HRESULT
     182Declare Function VarI8FromI4 Lib "oleaut32" (lIn As Long, ByRef i64Out As Int64) As HRESULT
    183183Declare Function VarI8FromR4 Lib "oleaut32" (fltIn As Single, ByRef i64Out As Int64) As HRESULT
    184184Declare Function VarI8FromR8 Lib "oleaut32" (dblIn As Double, ByRef i64Out As Int64) As HRESULT
     
    188188Declare Function VarI8FromDisp Lib "oleaut32" (pdispIn As *IDispatch, lcid As LCID, ByRef i64Out As Int64) As HRESULT
    189189Declare Function VarI8FromBool Lib "oleaut32" (boolIn As VARIANT_BOOL, ByRef i64Out As Int64) As HRESULT
    190 Declare Function VarI8FromI1 Lib "oleaut32" (cIn As CHAR, ByRef i64Out As Int64) As HRESULT
     190Declare Function VarI8FromI1 Lib "oleaut32" (cIn As SByte, ByRef i64Out As Int64) As HRESULT
    191191Declare Function VarI8FromUI2 Lib "oleaut32" (uiIn As Word, ByRef i64Out As Int64) As HRESULT
    192192Declare Function VarI8FromUI4 Lib "oleaut32" (ulIn As DWord, ByRef i64Out As Int64) As HRESULT
     
    196196Declare Function VarR4FromUI1 Lib "oleaut32" (bIn As Byte, ByRef fltOut As Single) As HRESULT
    197197Declare Function VarR4FromI2 Lib "oleaut32" (sIn As Integer, ByRef fltOut As Single) As HRESULT
    198 Declare Function VarR4FromI4 Lib "oleaut32" (lIn As LONG, ByRef fltOut As Single) As HRESULT
     198Declare Function VarR4FromI4 Lib "oleaut32" (lIn As Long, ByRef fltOut As Single) As HRESULT
    199199Declare Function VarR4FromI8 Lib "oleaut32" (i64In As Int64, ByRef fltOut As Single) As HRESULT
    200200Declare Function VarR4FromR8 Lib "oleaut32" (dblIn As Double, ByRef fltOut As Single) As HRESULT
     
    204204Declare Function VarR4FromDisp Lib "oleaut32" (pdispIn As *IDispatch, lcid As LCID, ByRef fltOut As Single) As HRESULT
    205205Declare Function VarR4FromBool Lib "oleaut32" (boolIn As VARIANT_BOOL, ByRef fltOut As Single) As HRESULT
    206 Declare Function VarR4FromI1 Lib "oleaut32" (cIn As CHAR, ByRef fltOut As Single) As HRESULT
     206Declare Function VarR4FromI1 Lib "oleaut32" (cIn As SByte, ByRef fltOut As Single) As HRESULT
    207207Declare Function VarR4FromUI2 Lib "oleaut32" (uiIn As Word, ByRef fltOut As Single) As HRESULT
    208208Declare Function VarR4FromUI4 Lib "oleaut32" (ulIn As DWord, ByRef fltOut As Single) As HRESULT
     
    212212Declare Function VarR8FromUI1 Lib "oleaut32" (bIn As Byte, ByRef dblOut As Double) As HRESULT
    213213Declare Function VarR8FromI2 Lib "oleaut32" (sIn As Integer, ByRef dblOut As Double) As HRESULT
    214 Declare Function VarR8FromI4 Lib "oleaut32" (lIn As LONG, ByRef dblOut As Double) As HRESULT
     214Declare Function VarR8FromI4 Lib "oleaut32" (lIn As Long, ByRef dblOut As Double) As HRESULT
    215215Declare Function VarR8FromI8 Lib "oleaut32" (i64In As Int64, ByRef dblOut As Double) As HRESULT
    216216Declare Function VarR8FromR4 Lib "oleaut32" (fltIn As Single, ByRef dblOut As Double) As HRESULT
     
    220220Declare Function VarR8FromDisp Lib "oleaut32" (pdispIn As *IDispatch, lcid As LCID, ByRef dblOut As Double) As HRESULT
    221221Declare Function VarR8FromBool Lib "oleaut32" (boolIn As VARIANT_BOOL, ByRef dblOut As Double) As HRESULT
    222 Declare Function VarR8FromI1 Lib "oleaut32" (cIn As CHAR, ByRef dblOut As Double) As HRESULT
     222Declare Function VarR8FromI1 Lib "oleaut32" (cIn As SByte, ByRef dblOut As Double) As HRESULT
    223223Declare Function VarR8FromUI2 Lib "oleaut32" (uiIn As Word, ByRef dblOut As Double) As HRESULT
    224224Declare Function VarR8FromUI4 Lib "oleaut32" (ulIn As DWord, ByRef dblOut As Double) As HRESULT
     
    228228Declare Function VarDateFromUI1 Lib "oleaut32" (bIn As Byte, ByRef dateOut As DATE) As HRESULT
    229229Declare Function VarDateFromI2 Lib "oleaut32" (sIn As Integer, ByRef dateOut As DATE) As HRESULT
    230 Declare Function VarDateFromI4 Lib "oleaut32" (lIn As LONG, ByRef dateOut As DATE) As HRESULT
     230Declare Function VarDateFromI4 Lib "oleaut32" (lIn As Long, ByRef dateOut As DATE) As HRESULT
    231231Declare Function VarDateFromI8 Lib "oleaut32" (i64In As Int64, ByRef dateOut As DATE) As HRESULT
    232232Declare Function VarDateFromR4 Lib "oleaut32" (fltIn As Single, ByRef dateOut As DATE) As HRESULT
     
    236236Declare Function VarDateFromDisp Lib "oleaut32" (pdispIn As *IDispatch, lcid As LCID, ByRef dateOut As DATE) As HRESULT
    237237Declare Function VarDateFromBool Lib "oleaut32" (boolIn As VARIANT_BOOL, ByRef dateOut As DATE) As HRESULT
    238 Declare Function VarDateFromI1 Lib "oleaut32" (cIn As CHAR, ByRef dateOut As DATE) As HRESULT
     238Declare Function VarDateFromI1 Lib "oleaut32" (cIn As SByte, ByRef dateOut As DATE) As HRESULT
    239239Declare Function VarDateFromUI2 Lib "oleaut32" (uiIn As Word, ByRef dateOut As DATE) As HRESULT
    240240Declare Function VarDateFromUI4 Lib "oleaut32" (ulIn As DWord, ByRef dateOut As DATE) As HRESULT
     
    244244Declare Function VarCyFromUI1 Lib "oleaut32" (bIn As Byte, ByRef cyOut As CY) As HRESULT
    245245Declare Function VarCyFromI2 Lib "oleaut32" (sIn As Integer, ByRef cyOut As CY) As HRESULT
    246 Declare Function VarCyFromI4 Lib "oleaut32" (lIn As LONG, ByRef cyOut As CY) As HRESULT
     246Declare Function VarCyFromI4 Lib "oleaut32" (lIn As Long, ByRef cyOut As CY) As HRESULT
    247247Declare Function VarCyFromI8 Lib "oleaut32" (i64In As Int64, ByRef cyOut As CY) As HRESULT
    248248Declare Function VarCyFromR4 Lib "oleaut32" (fltIn As Single, ByRef cyOut As CY) As HRESULT
     
    252252Declare Function VarCyFromDisp Lib "oleaut32" (pdispIn As *IDispatch, lcid As LCID, ByRef cyOut As CY) As HRESULT
    253253Declare Function VarCyFromBool Lib "oleaut32" (boolIn As VARIANT_BOOL, ByRef cyOut As CY) As HRESULT
    254 Declare Function VarCyFromI1 Lib "oleaut32" (cIn As CHAR, ByRef cyOut As CY) As HRESULT
     254Declare Function VarCyFromI1 Lib "oleaut32" (cIn As SByte, ByRef cyOut As CY) As HRESULT
    255255Declare Function VarCyFromUI2 Lib "oleaut32" (uiIn As Word, ByRef cyOut As CY) As HRESULT
    256256Declare Function VarCyFromUI4 Lib "oleaut32" (ulIn As DWord, ByRef cyOut As CY) As HRESULT
     
    260260Declare Function VarBstrFromUI1 Lib "oleaut32" (bIn As Byte, lcid As LCID, dwFlags As DWord, ByRef bstrOut As BSTR) As HRESULT
    261261Declare Function VarBstrFromI2 Lib "oleaut32" (sIn As Integer, lcid As LCID, dwFlags As DWord, ByRef bstrOut As BSTR) As HRESULT
    262 Declare Function VarBstrFromI4 Lib "oleaut32" (lIn As LONG, lcid As LCID, dwFlags As DWord, ByRef bstrOut As BSTR) As HRESULT
     262Declare Function VarBstrFromI4 Lib "oleaut32" (lIn As Long, lcid As LCID, dwFlags As DWord, ByRef bstrOut As BSTR) As HRESULT
    263263Declare Function VarBstrFromI8 Lib "oleaut32" (i64In As Int64, lcid As LCID, dwFlags As DWord, ByRef bstrOut As BSTR) As HRESULT
    264264Declare Function VarBstrFromR4 Lib "oleaut32" (fltIn As Single, lcid As LCID, dwFlags As DWord, ByRef bstrOut As BSTR) As HRESULT
     
    268268Declare Function VarBstrFromDisp Lib "oleaut32" (pdispIn As *IDispatch, lcid As LCID, dwFlags As DWord, ByRef bstrOut As BSTR) As HRESULT
    269269Declare Function VarBstrFromBool Lib "oleaut32" (boolIn As VARIANT_BOOL, lcid As LCID, dwFlags As DWord, ByRef bstrOut As BSTR) As HRESULT
    270 Declare Function VarBstrFromI1 Lib "oleaut32" (cIn As CHAR, lcid As LCID, dwFlags As DWord, ByRef bstrOut As BSTR) As HRESULT
     270Declare Function VarBstrFromI1 Lib "oleaut32" (cIn As SByte, lcid As LCID, dwFlags As DWord, ByRef bstrOut As BSTR) As HRESULT
    271271Declare Function VarBstrFromUI2 Lib "oleaut32" (uiIn As Word, lcid As LCID, dwFlags As DWord, ByRef bstrOut As BSTR) As HRESULT
    272272Declare Function VarBstrFromUI4 Lib "oleaut32" (ulIn As DWord, lcid As LCID, dwFlags As DWord, ByRef bstrOut As BSTR) As HRESULT
     
    276276Declare Function VarBoolFromUI1 Lib "oleaut32" (bIn As Byte, ByRef boolOut As VARIANT_BOOL) As HRESULT
    277277Declare Function VarBoolFromI2 Lib "oleaut32" (sIn As Integer, ByRef boolOut As VARIANT_BOOL) As HRESULT
    278 Declare Function VarBoolFromI4 Lib "oleaut32" (lIn As LONG, ByRef boolOut As VARIANT_BOOL) As HRESULT
     278Declare Function VarBoolFromI4 Lib "oleaut32" (lIn As Long, ByRef boolOut As VARIANT_BOOL) As HRESULT
    279279Declare Function VarBoolFromI8 Lib "oleaut32" (i64In As Int64, ByRef boolOut As VARIANT_BOOL) As HRESULT
    280280Declare Function VarBoolFromR4 Lib "oleaut32" (fltIn As Single, ByRef boolOut As VARIANT_BOOL) As HRESULT
     
    284284Declare Function VarBoolFromStr Lib "oleaut32" (strIn As *OLECHAR, lcid As LCID, dwFlags As DWord, ByRef boolOut As VARIANT_BOOL) As HRESULT
    285285Declare Function VarBoolFromDisp Lib "oleaut32" (pdispIn As *IDispatch, lcid As LCID, ByRef boolOut As VARIANT_BOOL) As HRESULT
    286 Declare Function VarBoolFromI1 Lib "oleaut32" (cIn As CHAR, ByRef boolOut As VARIANT_BOOL) As HRESULT
     286Declare Function VarBoolFromI1 Lib "oleaut32" (cIn As SByte, ByRef boolOut As VARIANT_BOOL) As HRESULT
    287287Declare Function VarBoolFromUI2 Lib "oleaut32" (uiIn As Word, ByRef boolOut As VARIANT_BOOL) As HRESULT
    288288Declare Function VarBoolFromUI4 Lib "oleaut32" (ulIn As DWord, ByRef boolOut As VARIANT_BOOL) As HRESULT
     
    291291
    292292Declare Function VarI1FromI2 Lib "oleaut32" (sIn As Integer, ByRef cOut As Char) As HRESULT
    293 Declare Function VarI1FromI4 Lib "oleaut32" (lIn As LONG, ByRef cOut As Char) As HRESULT
     293Declare Function VarI1FromI4 Lib "oleaut32" (lIn As Long, ByRef cOut As Char) As HRESULT
    294294Declare Function VarI1FromI8 Lib "oleaut32" (i64In As Int64, ByRef cOut As Char) As HRESULT
    295295Declare Function VarI1FromR4 Lib "oleaut32" (fltIn As Single, ByRef cOut As Char) As HRESULT
     
    300300Declare Function VarI1FromDisp Lib "oleaut32" (pdispIn As *IDispatch, lcid As LCID, ByRef cOut As Char) As HRESULT
    301301Declare Function VarI1FromBool Lib "oleaut32" (boolIn As VARIANT_BOOL, ByRef cOut As Char) As HRESULT
    302 Declare Function VarI1FromI1 Lib "oleaut32" (cIn As CHAR, ByRef cOut As Char) As HRESULT
     302Declare Function VarI1FromI1 Lib "oleaut32" (cIn As SByte, ByRef cOut As Char) As HRESULT
    303303Declare Function VarI1FromUI2 Lib "oleaut32" (uiIn As Word, ByRef cOut As Char) As HRESULT
    304304Declare Function VarI1FromUI4 Lib "oleaut32" (ulIn As DWord, ByRef cOut As Char) As HRESULT
     
    308308Declare Function VarUI2FromUI1 Lib "oleaut32" (bIn As Byte, ByRef uiOut As Word) As HRESULT
    309309Declare Function VarUI2FromI2 Lib "oleaut32" (uiIn As Integer, ByRef uiOut As Word) As HRESULT
    310 Declare Function VarUI2FromI4 Lib "oleaut32" (lIn As LONG, ByRef uiOut As Word) As HRESULT
     310Declare Function VarUI2FromI4 Lib "oleaut32" (lIn As Long, ByRef uiOut As Word) As HRESULT
    311311Declare Function VarUI2FromI8 Lib "oleaut32" (i64In As Int64, ByRef uiOut As Word) As HRESULT
    312312Declare Function VarUI2FromR4 Lib "oleaut32" (fltIn As Single, ByRef uiOut As Word) As HRESULT
     
    317317Declare Function VarUI2FromDisp Lib "oleaut32" (pdispIn As *IDispatch, lcid As LCID, ByRef uiOut As Word) As HRESULT
    318318Declare Function VarUI2FromBool Lib "oleaut32" (boolIn As VARIANT_BOOL, ByRef uiOut As Word) As HRESULT
    319 Declare Function VarUI2FromI1 Lib "oleaut32" (cIn As CHAR, ByRef uiOut As Word) As HRESULT
     319Declare Function VarUI2FromI1 Lib "oleaut32" (cIn As SByte, ByRef uiOut As Word) As HRESULT
    320320Declare Function VarUI2FromUI4 Lib "oleaut32" (ulIn As DWord, ByRef uiOut As Word) As HRESULT
    321321Declare Function VarUI2FromUI8 Lib "oleaut32" (i64In As QWord, ByRef uiOut As Word) As HRESULT
     
    324324Declare Function VarUI4FromUI1 Lib "oleaut32" (bIn As Byte, ByRef ulOut As DWord) As HRESULT
    325325Declare Function VarUI4FromI2 Lib "oleaut32" (uiIn As Integer, ByRef ulOut As DWord) As HRESULT
    326 Declare Function VarUI4FromI4 Lib "oleaut32" (lIn As LONG, ByRef ulOut As DWord) As HRESULT
     326Declare Function VarUI4FromI4 Lib "oleaut32" (lIn As Long, ByRef ulOut As DWord) As HRESULT
    327327Declare Function VarUI4FromI8 Lib "oleaut32" (i64In As Int64, ByRef lOut As DWord) As HRESULT
    328328Declare Function VarUI4FromR4 Lib "oleaut32" (fltIn As Single, ByRef ulOut As DWord) As HRESULT
     
    333333Declare Function VarUI4FromDisp Lib "oleaut32" (pdispIn As *IDispatch, lcid As LCID, ByRef ulOut As DWord) As HRESULT
    334334Declare Function VarUI4FromBool Lib "oleaut32" (boolIn As VARIANT_BOOL, ByRef ulOut As DWord) As HRESULT
    335 Declare Function VarUI4FromI1 Lib "oleaut32" (cIn As CHAR, ByRef ulOut As DWord) As HRESULT
     335Declare Function VarUI4FromI1 Lib "oleaut32" (cIn As SByte, ByRef ulOut As DWord) As HRESULT
    336336Declare Function VarUI4FromUI2 Lib "oleaut32" (uiIn As Word, ByRef ulOut As DWord) As HRESULT
    337337Declare Function VarUI4FromUI8 Lib "oleaut32" (ui64In As QWord, ByRef lOut As DWord) As HRESULT
     
    340340Declare Function VarUI8FromUI1 Lib "oleaut32" (bIn As Byte, ByRef i64Out As QWord) As HRESULT
    341341Declare Function VarUI8FromI2 Lib "oleaut32" (sIn As Integer, ByRef i64Out As QWord) As HRESULT
    342 Declare Function VarUI8FromI4 Lib "oleaut32" (lIn As LONG, ByRef i64Out As QWord) As HRESULT
     342Declare Function VarUI8FromI4 Lib "oleaut32" (lIn As Long, ByRef i64Out As QWord) As HRESULT
    343343Declare Function VarUI8FromI8 Lib "oleaut32" (ui64In As Int64, ByRef i64Out As QWord) As HRESULT
    344344Declare Function VarUI8FromR4 Lib "oleaut32" (fltIn As Single, ByRef i64Out As QWord) As HRESULT
     
    349349Declare Function VarUI8FromDisp Lib "oleaut32" (pdispIn As *IDispatch, lcid As LCID, ByRef i64Out As QWord) As HRESULT
    350350Declare Function VarUI8FromBool Lib "oleaut32" (boolIn As VARIANT_BOOL, ByRef i64Out As QWord) As HRESULT
    351 Declare Function VarUI8FromI1 Lib "oleaut32" (cIn As CHAR, ByRef i64Out As QWord) As HRESULT
     351Declare Function VarUI8FromI1 Lib "oleaut32" (cIn As SByte, ByRef i64Out As QWord) As HRESULT
    352352Declare Function VarUI8FromUI2 Lib "oleaut32" (uiIn As Word, ByRef i64Out As QWord) As HRESULT
    353353Declare Function VarUI8FromUI4 Lib "oleaut32" (ulIn As DWord, ByRef i64Out As QWord) As HRESULT
     
    356356Declare Function VarDecFromUI1 Lib "oleaut32" (bIn As Byte, ByRef decOut As DECIMAL) As HRESULT
    357357Declare Function VarDecFromI2 Lib "oleaut32" (uiIn As Integer, ByRef decOut As DECIMAL) As HRESULT
    358 Declare Function VarDecFromI4 Lib "oleaut32" (lIn As LONG, ByRef decOut As DECIMAL) As HRESULT
     358Declare Function VarDecFromI4 Lib "oleaut32" (lIn As Long, ByRef decOut As DECIMAL) As HRESULT
    359359Declare Function VarDecFromI8 Lib "oleaut32" (i64In As Int64, ByRef decOut As DECIMAL) As HRESULT
    360360Declare Function VarDecFromR4 Lib "oleaut32" (fltIn As Single, ByRef decOut As DECIMAL) As HRESULT
     
    365365Declare Function VarDecFromDisp Lib "oleaut32" (pdispIn As *IDispatch, lcid As LCID, ByRef decOut As DECIMAL) As HRESULT
    366366Declare Function VarDecFromBool Lib "oleaut32" (boolIn As VARIANT_BOOL, ByRef decOut As DECIMAL) As HRESULT
    367 Declare Function VarDecFromI1 Lib "oleaut32" (cIn As CHAR, ByRef decOut As DECIMAL) As HRESULT
     367Declare Function VarDecFromI1 Lib "oleaut32" (cIn As SByte, ByRef decOut As DECIMAL) As HRESULT
    368368Declare Function VarDecFromUI2 Lib "oleaut32" (uiIn As Word, ByRef decOut As DECIMAL) As HRESULT
    369369Declare Function VarDecFromUI4 Lib "oleaut32" (ulIn As DWord, ByRef decOut As DECIMAL) As HRESULT
    370370Declare Function VarDecFromUI8 Lib "oleaut32" (ui64In As QWord, ByRef decOut As DECIMAL) As HRESULT
    371371
    372 Declare Function VarUI1FromInt Lib "oleaut32" Alias "VarUI1FromI4" (lIn As LONG, ByRef bOut As Byte) As HRESULT
     372Declare Function VarUI1FromInt Lib "oleaut32" Alias "VarUI1FromI4" (lIn As Long, ByRef bOut As Byte) As HRESULT
    373373Declare Function VarUI1FromUint Lib "oleaut32" Alias "VarUI1FromUI4" (ulIn As DWord, ByRef bOut As Byte) As HRESULT
    374 Declare Function VarI2FromInt Lib "oleaut32" Alias "VarI2FromI4" (lIn As LONG, ByRef sOut As Integer) As HRESULT
     374Declare Function VarI2FromInt Lib "oleaut32" Alias "VarI2FromI4" (lIn As Long, ByRef sOut As Integer) As HRESULT
    375375Declare Function VarI2FromUint Lib "oleaut32" Alias "VarI2FromUI4" (ulIn As DWord, ByRef sOut As Integer) As HRESULT
    376376Declare Function VarI4FromUint Lib "oleaut32" Alias "VarI4FromUI4" (ulIn As DWord, ByRef lOut As Long) As HRESULT
    377 Declare Function VarI8FromInt Lib "oleaut32" Alias "VarI8FromI4" (lIn As LONG, ByRef i64Out As Int64) As HRESULT
     377Declare Function VarI8FromInt Lib "oleaut32" Alias "VarI8FromI4" (lIn As Long, ByRef i64Out As Int64) As HRESULT
    378378Declare Function VarI8FromUint Lib "oleaut32" Alias "VarI8FromUI4" (ulIn As DWord, ByRef i64Out As Int64) As HRESULT
    379 Declare Function VarR4FromInt Lib "oleaut32" Alias "VarR4FromI4" (lIn As LONG, ByRef fltOut As Single) As HRESULT
     379Declare Function VarR4FromInt Lib "oleaut32" Alias "VarR4FromI4" (lIn As Long, ByRef fltOut As Single) As HRESULT
    380380Declare Function VarR4FromUint Lib "oleaut32" Alias "VarR4FromUI4" (ulIn As DWord, ByRef fltOut As Single) As HRESULT
    381 Declare Function VarR8FromInt Lib "oleaut32" Alias "VarR8FromI4" (lIn As LONG, ByRef dblOut As Double) As HRESULT
     381Declare Function VarR8FromInt Lib "oleaut32" Alias "VarR8FromI4" (lIn As Long, ByRef dblOut As Double) As HRESULT
    382382Declare Function VarR8FromUint Lib "oleaut32" Alias "VarR8FromUI4" (ulIn As DWord, ByRef dblOut As Double) As HRESULT
    383 Declare Function VarDateFromInt Lib "oleaut32" Alias "VarDateFromI4" (lIn As LONG, ByRef dateOut As DATE) As HRESULT
     383Declare Function VarDateFromInt Lib "oleaut32" Alias "VarDateFromI4" (lIn As Long, ByRef dateOut As DATE) As HRESULT
    384384Declare Function VarDateFromUint Lib "oleaut32" Alias "VarDateFromUI4" (ulIn As DWord, ByRef dateOut As DATE) As HRESULT
    385 Declare Function VarCyFromInt Lib "oleaut32" Alias "VarCyFromI4" (lIn As LONG, ByRef cyOut As CY) As HRESULT
     385Declare Function VarCyFromInt Lib "oleaut32" Alias "VarCyFromI4" (lIn As Long, ByRef cyOut As CY) As HRESULT
    386386Declare Function VarCyFromUint Lib "oleaut32" Alias "VarCyFromUI4" (ulIn As DWord, ByRef cyOut As CY) As HRESULT
    387 Declare Function VarBstrFromInt Lib "oleaut32" Alias "VarBstrFromI4" (lIn As LONG, lcid As LCID, dwFlags As DWord, ByRef bstrOut As BSTR) As HRESULT
     387Declare Function VarBstrFromInt Lib "oleaut32" Alias "VarBstrFromI4" (lIn As Long, lcid As LCID, dwFlags As DWord, ByRef bstrOut As BSTR) As HRESULT
    388388Declare Function VarBstrFromUint Lib "oleaut32" Alias "VarBstrFromUI4" (ulIn As DWord, lcid As LCID, dwFlags As DWord, ByRef bstrOut As BSTR) As HRESULT
    389 Declare Function VarBoolFromInt Lib "oleaut32" Alias "VarBoolFromI4" (lIn As LONG, ByRef boolOut As VARIANT_BOOL) As HRESULT
     389Declare Function VarBoolFromInt Lib "oleaut32" Alias "VarBoolFromI4" (lIn As Long, ByRef boolOut As VARIANT_BOOL) As HRESULT
    390390Declare Function VarBoolFromUint Lib "oleaut32" Alias "VarBoolFromUI4" (ulIn As DWord, ByRef boolOut As VARIANT_BOOL) As HRESULT
    391 Declare Function VarI1FromInt Lib "oleaut32" Alias "VarI1FromI4" (lIn As LONG, ByRef cOut As Char) As HRESULT
     391Declare Function VarI1FromInt Lib "oleaut32" Alias "VarI1FromI4" (lIn As Long, ByRef cOut As Char) As HRESULT
    392392Declare Function VarI1FromUint Lib "oleaut32" Alias "VarI1FromUI4" (ulIn As DWord, ByRef cOut As Char) As HRESULT
    393 Declare Function VarUI2FromInt Lib "oleaut32" Alias "VarUI2FromI4" (lIn As LONG, ByRef uiOut As Word) As HRESULT
     393Declare Function VarUI2FromInt Lib "oleaut32" Alias "VarUI2FromI4" (lIn As Long, ByRef uiOut As Word) As HRESULT
    394394Declare Function VarUI2FromUint Lib "oleaut32" Alias "VarUI2FromUI4" (ulIn As DWord, ByRef uiOut As Word) As HRESULT
    395 Declare Function VarUI4FromInt Lib "oleaut32" Alias "VarUI4FromI4" (lIn As LONG, ByRef ulOut As DWord) As HRESULT
    396 Declare Function VarUI8FromInt Lib "oleaut32" Alias "VarUI8FromI4" (lIn As LONG, ByRef i64Out As QWord) As HRESULT
     395Declare Function VarUI4FromInt Lib "oleaut32" Alias "VarUI4FromI4" (lIn As Long, ByRef ulOut As DWord) As HRESULT
     396Declare Function VarUI8FromInt Lib "oleaut32" Alias "VarUI8FromI4" (lIn As Long, ByRef i64Out As QWord) As HRESULT
    397397Declare Function VarUI8FromUint Lib "oleaut32" Alias "VarUI8FromUI4" (ulIn As DWord, ByRef i64Out As QWord) As HRESULT
    398 Declare Function VarDecFromInt Lib "oleaut32" Alias "VarDecFromI4" (lIn As LONG, ByRef decOut As DECIMAL) As HRESULT
     398Declare Function VarDecFromInt Lib "oleaut32" Alias "VarDecFromI4" (lIn As Long, ByRef decOut As DECIMAL) As HRESULT
    399399
    400400Declare Function VarIntFromUI1 Lib "oleaut32" Alias "VarI4FromUI1" (bIn As Byte, ByRef lOut As Long) As HRESULT
     
    408408Declare Function VarIntFromDisp Lib "oleaut32" Alias "VarI4FromDisp" (pdispIn As *IDispatch, lcid As LCID, ByRef lOut As Long) As HRESULT
    409409Declare Function VarIntFromBool Lib "oleaut32" Alias "VarI4FromBool" (boolIn As VARIANT_BOOL, ByRef lOut As Long) As HRESULT
    410 Declare Function VarIntFromI1 Lib "oleaut32" Alias "VarI4FromI1" (cIn As CHAR, ByRef lOut As Long) As HRESULT
     410Declare Function VarIntFromI1 Lib "oleaut32" Alias "VarI4FromI1" (cIn As SByte, ByRef lOut As Long) As HRESULT
    411411Declare Function VarIntFromUI2 Lib "oleaut32" Alias "VarI4FromUI2" (uiIn As Word, ByRef lOut As Long) As HRESULT
    412412Declare Function VarIntFromUI4 Lib "oleaut32" Alias "VarI4FromUI4" (ulIn As DWord, ByRef lOut As Long) As HRESULT
     
    416416Declare Function VarIntFromUint Lib "oleaut32" Alias "VarI4FromUI4" (ulIn As DWord, ByRef lOut As Long) As HRESULT
    417417Declare Function VarUintFromI2 Lib "oleaut32" Alias "VarUI4FromI2" (uiIn As Integer, ByRef ulOut As DWord) As HRESULT
    418 Declare Function VarUintFromI4 Lib "oleaut32" Alias "VarUI4FromI4" (lIn As LONG, ByRef ulOut As DWord) As HRESULT
     418Declare Function VarUintFromI4 Lib "oleaut32" Alias "VarUI4FromI4" (lIn As Long, ByRef ulOut As DWord) As HRESULT
    419419Declare Function VarUintFromI8 Lib "oleaut32" Alias "VarUI4FromI8" (i64In As Int64, ByRef lOut As DWord) As HRESULT
    420420Declare Function VarUintFromR4 Lib "oleaut32" Alias "VarUI4FromR4" (fltIn As Single, ByRef ulOut As DWord) As HRESULT
     
    425425Declare Function VarUintFromDisp Lib "oleaut32" Alias "VarUI4FromDisp" (pdispIn As *IDispatch, lcid As LCID, ByRef ulOut As DWord) As HRESULT
    426426Declare Function VarUintFromBool Lib "oleaut32" Alias "VarUI4FromBool" (boolIn As VARIANT_BOOL, ByRef ulOut As DWord) As HRESULT
    427 Declare Function VarUintFromI1 Lib "oleaut32" Alias "VarUI4FromI1" (cIn As CHAR, ByRef ulOut As DWord) As HRESULT
     427Declare Function VarUintFromI1 Lib "oleaut32" Alias "VarUI4FromI1" (cIn As SByte, ByRef ulOut As DWord) As HRESULT
    428428Declare Function VarUintFromUI2 Lib "oleaut32" Alias "VarUI4FromUI2" (uiIn As Word, ByRef ulOut As DWord) As HRESULT
    429429Declare Function VarUintFromUI8 Lib "oleaut32" Alias "VarUI4FromUI8" (ui64In As QWord, ByRef lOut As DWord) As HRESULT
    430430Declare Function VarUintFromDec Lib "oleaut32" Alias "VarUI4FromDec" (ByRef decIn As DECIMAL, ByRef ulOut As DWord) As HRESULT
    431 Declare Function VarUintFromInt Lib "oleaut32" Alias "VarUI4FromI4" (lIn As LONG, ByRef ulOut As DWord) As HRESULT
     431Declare Function VarUintFromInt Lib "oleaut32" Alias "VarUI4FromI4" (lIn As Long, ByRef ulOut As DWord) As HRESULT
    432432
    433433Sub VarI4FromInt(iIn As Long, ByRef lOut As Long)
     
    566566End Type
    567567
    568 Declare Function VarDateFromUdate Lib "oleaut32" (udateIn As UDATE, dwFlags As DWord, ByRef dateOut As DATE) As HRESULT
    569 Declare Function VarDateFromUdateEx Lib "oleaut32" (udateIn As UDATE, lcid As LCID, dwFlags As DWord, ByRef dateOut As DATE) As HRESULT
     568Declare Function VarDateFromUdate Lib "oleaut32" (ByRef udateIn As UDATE, dwFlags As DWord, ByRef dateOut As DATE) As HRESULT
     569Declare Function VarDateFromUdateEx Lib "oleaut32" (ByRef udateIn As UDATE, lcid As LCID, dwFlags As DWord, ByRef dateOut As DATE) As HRESULT
    570570Declare Function VarUdateFromDate Lib "oleaut32" (dateIn As DATE, dwFlags As DWord, ByRef udateOut As UDATE) As HRESULT
    571571
     
    586586
    587587' ITypeLib
    588 TypeDef PTYPELIB = VoidPtr '*ITypeLib
     588TypeDef PTYPELIB = *ITypeLib
    589589
    590590' ITypeInfo
  • Include/api_imm.sbp

    r179 r192  
    115115TypeDef LPSTYLEBUF = LPSTYLEBUFA
    116116#endif
    117 
    118 '#if (WINVER >= 0x040A)
    119117
    120118Const IMEMENUITEM_STRING_SIZE = 80
     
    221219#endif
    222220
    223 Declare Function ImmSetCompositionStringA Lib "imm32" (himc As HIMC, dwIndex As DWord, lpComp As VoidPtr, dwCompLen As DWord, lpRead As VoidPtr, dwReadLen As DWord ) As BOOL
    224 Declare Function ImmSetCompositionStringW Lib "imm32" (himc As HIMC, dwIndex As DWord, lpComp As VoidPtr, dwCompLen As DWord, lpRead As VoidPtr, dwReadLen As DWord ) As BOOL
    225 #ifdef UNICODE
    226 Declare Function ImmSetCompositionString Lib "imm32" Alias "ImmSetCompositionStringW" (himc As HIMC, dwIndex As DWord, lpComp As VoidPtr, dwCompLen As DWord, lpRead As VoidPtr, dwReadLen As DWord ) As BOOL
    227 #else
    228 Declare Function ImmSetCompositionString Lib "imm32" Alias "ImmSetCompositionStringA" (himc As HIMC, dwIndex As DWord, lpComp As VoidPtr, dwCompLen As DWord, lpRead As VoidPtr, dwReadLen As DWord ) As BOOL
     221Declare Function ImmSetCompositionStringA Lib "imm32" (himc As HIMC, dwIndex As DWord, lpComp As VoidPtr, dwCompLen As DWord, lpRead As VoidPtr, dwReadLen As DWord) As BOOL
     222Declare Function ImmSetCompositionStringW Lib "imm32" (himc As HIMC, dwIndex As DWord, lpComp As VoidPtr, dwCompLen As DWord, lpRead As VoidPtr, dwReadLen As DWord) As BOOL
     223#ifdef UNICODE
     224Declare Function ImmSetCompositionString Lib "imm32" Alias "ImmSetCompositionStringW" (himc As HIMC, dwIndex As DWord, lpComp As VoidPtr, dwCompLen As DWord, lpRead As VoidPtr, dwReadLen As DWord) As BOOL
     225#else
     226Declare Function ImmSetCompositionString Lib "imm32" Alias "ImmSetCompositionStringA" (himc As HIMC, dwIndex As DWord, lpComp As VoidPtr, dwCompLen As DWord, lpRead As VoidPtr, dwReadLen As DWord) As BOOL
    229227#endif
    230228
     
    245243#endif
    246244
    247 Declare Function ImmGetGuideLineA(himc As HIMC, dwIndex As DWord, lpBuf As LPSTR, dwBufLen As DWord) As DWord
    248 Declare Function ImmGetGuideLineW(himc As HIMC, dwIndex As DWord, lpBuf As LPWSTR, dwBufLen As DWord) As DWord
    249 #ifdef UNICODE
    250 Declare Function ImmGetGuideLine Alias "ImmGetGuideLineW" (himc As HIMC, dwIndex As DWord, lpBuf As LPWSTR, dwBufLen As DWord) As DWord
    251 #else
    252 Declare Function ImmGetGuideLine Alias "ImmGetGuideLineA" (himc As HIMC, dwIndex As DWord, lpBuf As LPSTR, dwBufLen As DWord) As DWord
    253 #endif
    254 
    255 Declare Function ImmGetConversionStatus(himc As HIMC, ByRef fdwConversion As DWord, ByRef fdwSentence As DWord) As BOOL
    256 Declare Function ImmSetConversionStatus(himc As HIMC, fdwConversion As DWord, fdwSentence As DWord) As BOOL
    257 Declare Function ImmGetOpenStatus(himc As HIMC) As BOOL
    258 Declare Function ImmSetOpenStatus(himc As HIMC, fOpen As BOOL) As BOOL
     245Declare Function ImmGetGuideLineA Lib "imm32" (himc As HIMC, dwIndex As DWord, lpBuf As LPSTR, dwBufLen As DWord) As DWord
     246Declare Function ImmGetGuideLineW Lib "imm32" (himc As HIMC, dwIndex As DWord, lpBuf As LPWSTR, dwBufLen As DWord) As DWord
     247#ifdef UNICODE
     248Declare Function ImmGetGuideLine Lib "imm32"  Alias "ImmGetGuideLineW" (himc As HIMC, dwIndex As DWord, lpBuf As LPWSTR, dwBufLen As DWord) As DWord
     249#else
     250Declare Function ImmGetGuideLine Lib "imm32"  Alias "ImmGetGuideLineA" (himc As HIMC, dwIndex As DWord, lpBuf As LPSTR, dwBufLen As DWord) As DWord
     251#endif
     252
     253Declare Function ImmGetConversionStatus Lib "imm32" (himc As HIMC, ByRef fdwConversion As DWord, ByRef fdwSentence As DWord) As BOOL
     254Declare Function ImmSetConversionStatus Lib "imm32" (himc As HIMC, fdwConversion As DWord, fdwSentence As DWord) As BOOL
     255Declare Function ImmGetOpenStatus Lib "imm32" (himc As HIMC) As BOOL
     256Declare Function ImmSetOpenStatus Lib "imm32" (himc As HIMC, fOpen As BOOL) As BOOL
    259257
    260258#ifdef _INC_GDI '_WINGDI_
    261 #ifndef NOGID
     259#ifndef NOGDI
    262260Declare Function ImmGetCompositionFontA Lib "imm32" (hIMC As HIMC, ByRef lf As LOGFONTA) As BOOL
    263261Declare Function ImmGetCompositionFontW Lib "imm32" (hIMC As HIMC, ByRef lf As LOGFONTW) As BOOL
     
    275273Declare Function ImmSetCompositionFont Lib "imm32" Alias "ImmSetCompositionFontA" (hIMC As HIMC, ByRef lf As LOGFONT) As Long
    276274#endif
    277 #endif 'NOGID
     275#endif 'NOGDI
    278276#endif '_INC_GDI
     277#endif
    279278
    280279Declare Function ImmConfigureIMEA Lib "imm32" (hkl As HKL, hwnd As HWND, dwMode As DWord, lpData As VoidPtr) As BOOL
     
    368367Declare Function ImmGetImeMenuItems Lib "imm32" Alias "ImmGetImeMenuItemsA" (himc As HIMC, dwFlags As DWord, dwType As DWord, ByRef ImeParentMenu As IMEMENUITEMINFOA, lpImeMenu As LPIMEMENUITEMINFOA, dwSoze As DWord) As DWord
    369368#endif
    370 Declare Function ImmDisableTextFrameService(idThread As DWord) As BOOL
     369Declare Function ImmDisableTextFrameService Lib "imm32"(idThread As DWord) As BOOL
    371370
    372371' wParam for WM_IME_CONTROL
     
    705704Const SOFTKEYBOARD_TYPE_C1 = &h0002
    706705
    707 
    708706#endif '_IMM_SDK_DEFINED_
    709707
  • Include/basic/function.sbp

    r175 r192  
    555555    '値が0の場合
    556556    If value = 0 Then
    557         _System_FillChar(_System_ecvt_buffer, count, &H30)
     557        _System_FillChar(_System_ecvt_buffer, count As SIZE_T, &H30 As StrChar)
    558558        _System_ecvt_buffer[count] = 0
    559559        dec = 0
  • Include/basic/prompt.sbp

    r151 r192  
    494494
    495495    'Create Prompt Window
    496     _PromptSys_hWnd = CreateWindowEx(WS_EX_CLIENTEDGE, atom As ULONG_PTR As PCTSTR, "BASIC PROMPT",
    497         WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
     496    _PromptSys_hWnd = CreateWindowEx(WS_EX_CLIENTEDGE, atom As ULONG_PTR As LPCTSTR, "BASIC PROMPT", _
     497        WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, _
    498498        0, 0, wcl.hInstance, 0)
    499499    ShowWindow(_PromptSys_hWnd, SW_SHOW)
     
    540540        For i = 0 To 100
    541541            With _PromptSys_TextLine[i]
    542                 .Text[0] = 0 '_System_FillChar(_PromptSys_TextLine[i].Text, -1 As Char, 0)
     542                .Text[0] = 0 '_System_FillChar(_PromptSys_TextLine[i].Text, -1 As StrChar, 0)
    543543                .Length = 0
    544544            End With
     
    646646    Dim i = _PromptSys_TextLine[y].Length
    647647    If i < x Then
    648         _System_FillChar(VarPtr(_PromptSys_TextLine[y].Text[i]), x - i, &h20) 'Asc(" ")
     648        _System_FillChar(VarPtr(_PromptSys_TextLine[y].Text[i]), x - i, &h20 As StrChar) 'Asc(" ")
    649649        Dim i2 As Long
    650650        For i2 = i To ELM(x)
  • Include/com/bstring.ab

    r175 r192  
    8080    End Sub
    8181
    82     Sub Attach(bstr As BSTR)
     82    Sub Attach(ByRef bstr As BSTR)
    8383        Clear()
    8484        BString.Move(bs, bstr)
  • Include/com/index.ab

    r142 r192  
    22
    33#require <com/bstring.ab>
     4#require <com/variant.ab>
     5#require <com/vbojbect.ab>
     6#require <com/currency.ab>
  • Include/com/variant.ab

    r175 r192  
    2020    End Sub
    2121
    22     Sub Variant(v As VARIANT)
     22    Sub Variant(ByRef y As VARIANT)
    2323        VariantInit(v)
    2424        VariantCopy(v, y)
     
    132132    End Sub
    133133
    134     Sub Assign(from As VARIANT)
    135         Clear()
     134    Sub Assign(ByRef from As VARIANT)
    136135        Variant.Copy(v, from)
     136    End Sub
     137
     138    Sub AssignInd(ByRef from As VARIANT)
     139        VariantCopyInd(v, from)
    137140    End Sub
    138141
     
    141144    End Sub
    142145
     146    Const Function Copy() As VARIANT
     147        Variant.Copy(Copy, v)
     148    End Function
     149
    143150    Function Detach() As VARIANT
    144151        Variant.Move(Detach, v)
     
    153160    End Function
    154161
    155     Function Operator -() As Variant
     162    Const Function Operator +() As Variant
     163        Return New Variant(This)
     164    End Function
     165
     166    Const Function Operator -() As Variant
    156167        Dim ret As Variant
    157168        VarNeg(This.v, ret.v)
     
    219230    End Function
    220231
    221     Function Operator Not() As Variant
     232    Const Function Operator Not() As Variant
    222233        Dim ret As Variant
    223234        VarNot(This.v, ret.v)
     
    237248    End Function
    238249
    239     Function Abs() As Variant
     250    Const Function Abs() As Variant
    240251        Dim ret As Variant
    241252        VarAbs(This.v, ret.v)
     
    243254    End Function
    244255
    245     Function Fix() As Variant
     256    Const Function Fix() As Variant
    246257        Dim ret As Variant
    247258        VarFix(This.v, ret.v)
     
    249260    End Function
    250261
    251     Function Int() As Variant
     262    Const Function Int() As Variant
    252263        Dim ret As Variant
    253264        VarInt(This.v, ret.v)
     
    255266    End Function
    256267
    257     Function Round(cDecimals As Long) As Variant
     268    Const Function Round(cDecimals As Long) As Variant
    258269        Dim ret As Variant
    259270        VarRound(This.v, cDecimals, ret)
     
    261272    End Function
    262273
    263     Function Round() As Variant
     274    Const Function Round() As Variant
    264275        Return Round(0)
    265276    End Function
     
    274285
    275286    Const Function Operator ==(y As Variant) As Boolean
    276         Return Compare(This, y) = VARCMP_EQ
     287        Dim c = Compare(This, y)
     288        If c = VARCMP_EQ Then
     289            Return True
     290        Else
     291            Return False
     292        End If
    277293    End Function
    278294
    279295    Const Function Operator <>(y As Variant) As Boolean
    280         Return Compare(This, y) <> VARCMP_EQ
     296        Dim c = Compare(This, y)
     297        If c <> VARCMP_EQ Then
     298            Return True
     299        Else
     300            Return False
     301        End If
    281302    End Function
    282303
    283304    Const Function Operator <(y As Variant) As Boolean
    284         Return Compare(This, y) = VARCMP_LT
    285     End Function
    286 
    287 '   Const Function Operator >(y As Variant) As Boolean
    288 '       Return Compare(This, y) = VARCMP_GT
    289 '   End Function
    290 
     305        Dim c = Compare(This, y)
     306        If c = VARCMP_LT Then
     307            Return True
     308        Else
     309            Return False
     310        End If
     311    End Function
     312/*
     313    Const Function Operator >(y As Variant) As Boolean
     314        Dim c = Compare(This, y)
     315        If c = VARCMP_GT Then
     316            Return True
     317        Else
     318            Return False
     319        End If
     320    End Function
     321*/
    291322    Const Function Operator <=(y As Variant) As Boolean
    292         Dim result = Compare(This, y)
    293         Return result = VARCMP_LT Or result = VARCMP_EQ
     323        Dim c = Compare(This, y)
     324        If result = VARCMP_LT Or result = VARCMP_EQ Then
     325            Return True
     326        Else
     327            Return False
     328        End If
    294329    End Function
    295330
    296331    Const Function Operator >=(y As Variant) As Boolean
    297         Dim result = Compare(This, y)
    298         Return result = VARCMP_GT Or result = VARCMP_EQ
     332        Dim c = Compare(This, y)
     333        If result = VARCMP_GT Or result = VARCMP_EQ Then
     334            Return True
     335        Else
     336            Return False
     337        End If
    299338    End Function
    300339
     
    469508    'ValDate
    470509
    471     Const Function ValBStr() As BString
     510    Const Function ValStr() As BString
    472511        Dim r As VARIANT
    473512        ChangeType(r, 0, VT_BSTR)
     
    477516    End Function
    478517
    479     Sub ValBStr(x As BString)
     518    Sub ValStr(x As BString)
    480519        Clear()
    481520        v.vt = VT_BSTR
     
    497536    Const Function ValObject() As VBObject
    498537        Dim r As VARIANT
    499         ChangeType(r, 0, VT_DISPATH)
    500         Dim o As VBOBject
     538        ChangeType(r, 0, VT_DISPATCH)
     539        Dim o As VBObject
    501540        o.Attach(GetPointer(VarPtr(r.val)) As *IDispatch)
    502541        Return o
     
    517556        Return VarPtr(v)
    518557    End Function
     558
    519559Private
    520560    v As VARIANT
     
    523563        VariantCopy(dst, src)
    524564    End Sub
    525        
     565
    526566
    527567    Static Sub Move(ByRef dst As VARIANT, ByRef src As VARIANT)
  • Include/com/vbobject.ab

    r186 r192  
    1212    End Sub
    1313
    14     Sub VBObject(className As String)
    15         VBObject(ToWCStr(className))
    16     End Sub
    17 
    18     Sub VBObject(className As PCWSTR)
     14    Sub VBObject(className As String, pOuter As *IUnknown, clsContext As DWord)
     15        VBObject(ToWCStr(className), pOuter, clsContext)
     16    End Sub
     17
     18    Sub VBObject(className As PCSTR, pOuter As *IUnknown, clsContext As DWord)
     19        VBObject(ToWCStr(className), pOuter, clsContext)
     20    End Sub
     21
     22    Sub VBObject(className As PCWSTR, pOuter As *IUnknown, clsContext As DWord)
    1923        pdisp = 0
    2024        Dim clsid As CLSID
    2125        Dim hr = _System_CLSIDFromString(className, clsid)
    22         Dim hr2 = CoCreateInstance(clsid, 0, CLSCTX_ALL, IID_IDispatch, pdisp)
     26        VBObject(clsid, pOuter, clsContext)
     27    End Sub
     28
     29    Sub VBObject(ByRef clsid As CLSID, pOuter As *IUnknown, clsContext As DWord)
     30        Dim hr = CoCreateInstance(clsid, pOuter, clsContext, IID_IDispatch, pdisp)
    2331    End Sub
    2432
     
    5361
    5462    Function Equals(y As VBObject) As Boolean
    55         Dim punkX = GetUnknown()
    56         Dim punkY = y.GetUnknown()
    57         Equals = (punkX == punkY)
    58         punkX->Release()
    59         punkY->Release()
     63        Return _System_COMReferenceEquals(pdisp, y.pdisp)
    6064    End Function
    6165/*
    6266    Override Function GetHashCode() As Long
    63         Dim punk = GetUnknown()
     67        Dim punk = _System_GetUnknown(pdisp)
    6468        GetHashCode = _System_HashFromPtr(punk)
    6569        punk->Release()
     
    7983    End Sub
    8084
    81     Function GetDispatch() As *IDispatch
     85    Function Copy() As *IDispatch
    8286        VBObject.Copy(GetDispatch, pdisp)
    8387    End Function
     
    8892    End Sub
    8993
    90     Sub Detach()
     94    Function Detach() As *IDispatch
    9195        VBObject.Move(Detach, pdisp)
    92     End Sub
     96    End Function
     97
     98    Function Dispatch() As *IDispatch
     99        Dispatch = pdisp
     100    End Function
    93101Private
    94102    Function GetCaller(name As PCWSTR) As DispatchCaller
     
    96104        Dim hr = pdisp->GetIDsOfNames(GUID_NULL, VarPtr(name), 1, LOCALE_USER_DEFAULT, VarPtr(dispid))
    97105        Return New DispatchCaller(pdisp, dispid)
    98     End Function
    99 
    100     Function GetUnknown() As *IUnknown
    101         If FAILDED(pdisp->QueryInterface(IID_Unknown, GetUnknown)) Then
    102             GetUnknown = 0
    103         End If
    104106    End Function
    105107
     
    170172
    171173    Sub Prop(ByRef arg As VARIANT)
    172         Dim dispParams As DISPPARAMS
    173         With dispParams
    174             .rgvarg = VarPtr(arg)
    175             .rgdispidNamedArgs = 0
    176             .cArgs = 1
    177             .cNamedArgs = 1
    178         End With
    179         Dim ret As VARIANT
    180         Dim hr = pdisp->Invoke(dispid, GUID_NULL, LOCALE_USER_DEFAULT, DISPATCH_PROPERTYPUT, dispParams, ret, ByVal 0, 0)
    181         Dispose()
     174        setProp(arg, DISPATCH_PROPERTYPUT)
    182175    End Sub
    183176
     
    187180
    188181    Sub PropRef(ByRef arg As VARIANT)
    189         Dim dispParams As DISPPARAMS
    190         With dispParams
    191             .rgvarg = 1
    192             .rgdispidNamedArgs = 0
    193             .cArgs = VarPtr(arg)
    194             .cNamedArgs = 0
    195         End With
    196         Dim ret As VARIANT
    197         Dim hr = pdisp->Invoke(dispid, GUID_NULL, LOCALE_USER_DEFAULT, DISPATCH_PROPERTYPUTREF, dispParams, ret, ByVal 0, 0)
    198         Dispose()
     182        setProp(arg, DISPATCH_PROPERTYPUTREF)
    199183    End Sub
    200184
     
    228212    Function Call(ByRef arg1 As Variant, ByRef arg2 As Variant) As Variant
    229213        Dim arg[1] As VARIANT
    230        
     214
    231215        Return Call(2, VarPtr(arg1) As *VARIANT)
    232216    End Function
    233217
    234218Private
     219    Sub setProp(ByRef arg As VARIANT, callType As Word)
     220        Dim dispidNamed = DISPID_PROPERTYPUT As DISPID
     221        Dim dispParams As DISPPARAMS
     222        With dispParams
     223            .rgvarg = VarPtr(arg)
     224            .rgdispidNamedArgs = VarPtr(dispidNamed)
     225            .cArgs = 1
     226            .cNamedArgs = 1
     227        End With
     228        Dim hr = pdisp->Invoke(dispid, GUID_NULL, LOCALE_USER_DEFAULT, callType, dispParams, ByVal 0, ByVal 0, 0)
     229        Dispose()
     230    End Sub
     231
     232
    235233    pdisp As *IDispatch
    236234    dispid As DISPID
    237235End Class
    238 /*
     236
     237Function CallByName(obj As VBObject, procName As String, callType As Word, cArgs As Long, args As *VARIANT) As Variant
     238    Return CallByName(obj.Dispatch, ToWCStr(procName), callType, cArgs, args)
     239End Function
     240
     241Function CallByName(obj As VBObject, procName As PCWSTR, callType As Word, cArgs As Long, args As *VARIANT) As Variant
     242    Return CallByName(obj.Dispatch, procName, callType, cArgs, args)
     243End Function
     244
     245Function CallByName(obj As *IDispatch, name As PCWSTR, callType As Word, cArgs As Long, args As *VARIANT) As Variant
     246    Dim dispid As DISPID
     247    Dim hr = obj->GetIDsOfNames(GUID_NULL, VarPtr(name), 1, LOCALE_USER_DEFAULT, VarPtr(dispid))
     248    Dim dispParams As DISPPARAMS
     249    With dispParams
     250        .rgvarg = args
     251        .rgdispidNamedArgs = 0
     252        .cArgs = cArgs
     253        .cNamedArgs = 0
     254    End With
     255    Dim ret As VARIANT
     256    hr = obj->Invoke(dispid, GUID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, dispParams, ret, ByVal 0, 0)
     257    CallByName.Attach(ret)
     258    Return CallByName
     259End Function
     260
    239261Function CreateObject(className As PCWSTR) As VBObject
    240262    Return New VBObject(className)
     
    244266    Return New VBObject(ToWCStr(className))
    245267End Function
    246 
     268/*
    247269#ifdef _WIN32_DCOM
    248270Function CreateObject(className As PCWSTR, serverName As PCWSTR) As VBObject
     
    250272    Dim si As COSERVERINFO
    251273    Dim context As DWord
    252     If /*Server = 0 OrElse* / Server[0] = 0 Then
    253         context = CLSCTX_SERVER
    254     Else
    255         context = CLSCTX_REMOTE_SERVER
    256         si.pwszName = serverName
    257     End If
     274    If /*Server = 0 OrElse* / Server[0] = 0 Then
     275        context = CLSCTX_SERVER
     276    Else
     277        context = CLSCTX_REMOTE_SERVER
     278        si.pwszName = serverName
     279    End If
    258280
    259281    Dim hr = _System_CLSIDFromString(className, clsid)
     
    270292        Return Nothing
    271293    End If
    272 End Function   
     294End Function
    273295
    274296Function CreateObject(className As String, serverName As String) As VBObject
     
    279301Function _System_CLSIDFromString(pwString As PCWSTR, ByRef guid As GUID) As HRESULT
    280302    If pwString[0] = &h007b As WCHAR Then
    281         ' 1文字目が { ならクラスIDの文字列表現と見なしCLSIDFromStringで変換。
    282         _System_CLSIDFromString = CLSIDFromString(pwString, guid)
    283     Else
    284         _System_CLSIDFromString = CLSIDFromProgID(pwString, guid)
    285     End If
     303        ' 1文字目が { ならクラスIDの文字列表現と見なしCLSIDFromStringで変換。
     304        _System_CLSIDFromString = CLSIDFromString(pwString, guid)
     305    Else
     306        _System_CLSIDFromString = CLSIDFromProgID(pwString, guid)
     307    End If
     308End Function
     309
     310Function _System_COMReferenceEquals(p As *IUnknown, q As *IUnknown) As Boolean
     311    If p = q Then
     312        Return True
     313    Else If p = 0 Or q = 0 Then
     314        Return False
     315    End If
     316
     317    Dim punkX = _System_GetUnknown(p)
     318    Dim punkY = _System_GetUnknown(q)
     319    If punkX = punkY Then
     320        _System_COMReferenceEquals = True
     321    Else
     322        _System_COMReferenceEquals = False
     323    End If
     324    punkX->Release()
     325    punkY->Release()
     326End Function
     327
     328Function _System_GetUnknown(p As *IUnknown) As *IUnknown 'pは任意のCOMインタフェース
     329    If FAILDED(pdisp->QueryInterface(IID_Unknown, _System_GetUnknown)) Then
     330        GetUnknown = 0
     331    End If
    286332End Function
    287333
  • Include/system/string.sbp

    r177 r192  
    3636Function GetStr(psz As PSTR, len As SIZE_T, ByRef wcs As PWSTR) As SIZE_T
    3737    If psz = 0 Then Return 0
    38     Dim sizeWCS = MultiByteToWideChar(CP_THREAD_ACP, 0, psz, len, 0, 0) + 1
    39     wcs = _System_AllocForConvertedString(SizeOf (WCHAR) * sizeWCS) As PWSTR
    40     GetStr = MultiByteToWideChar(CP_THREAD_ACP, 0, psz, len, wcs, sizeWCS)
     38    Dim lenWCS = MultiByteToWideChar(CP_THREAD_ACP, 0, psz, len, 0, 0)
     39    wcs = _System_AllocForConvertedString(SizeOf (WCHAR) * (lenWCS + 1)) As PWSTR
     40    GetStr = MultiByteToWideChar(CP_THREAD_ACP, 0, psz, len, wcs, lenWCS)
    4141    wcs[GetStr] = 0
    4242End Function
     
    7070Function GetStr(psz As PWSTR, len As SIZE_T, ByRef mbs As PSTR) As SIZE_T
    7171    If psz = 0 Then Return 0
    72     Dim sizeMBS = WideCharToMultiByte(CP_THREAD_ACP, 0, psz, len, 0, 0, 0, 0)
    73     mbs = _System_AllocForConvertedString(SizeOf (SByte) * (sizeMBS + 1)) As PSTR
    74     GetStr = WideCharToMultiByte(CP_THREAD_ACP, 0, psz, len, mbs, sizeMBS, 0, 0) As SIZE_T
     72    Dim lenMBS = WideCharToMultiByte(CP_THREAD_ACP, 0, psz, len, 0, 0, 0, 0)
     73    mbs = _System_AllocForConvertedString(SizeOf (SByte) * (lenMBS + 1)) As PSTR
     74    GetStr = WideCharToMultiByte(CP_THREAD_ACP, 0, psz, len, mbs, lenMBS, 0, 0) As SIZE_T
    7575    mbs[GetStr] = 0
    7676End Function
  • Include/windows/WindowHandle.sbp

    r178 r192  
    1 #ifndef __WINDOWSHANDLE_SBP__
    2 #define __WINDOWSHANDLE_SBP__
     1#ifndef __WINDOWS_WINDOWHANDLE_SBP__
     2#define __WINDOWS_WINDOWHANDLE_SBP__
    33
    44#ifdef _WIN64
    5 Declare Function _System_GetWindowLongPtr Lib "user32" Alias "GetWindowLongPtrA" (hWnd As HWND, nIndex As Long) As LONG_PTR
    6 Declare Function _System_SetWindowLongPtr Lib "user32" Alias "SetWindowLongPtrA" (hWnd As HWND, nIndex As Long, l As LONG_PTR) As LONG_PTR
     5Declare Function _System_GetWindowLongPtr Lib "user32" Alias _FuncName_GetWindowLongPtr (hWnd As HWND, nIndex As Long) As LONG_PTR
     6Declare Function _System_SetWindowLongPtr Lib "user32" Alias _FuncName_SetWindowLongPtr (hWnd As HWND, nIndex As Long, l As LONG_PTR) As LONG_PTR
    77#else
    8 Declare Function _System_GetWindowLongPtr Lib "user32" Alias "GetWindowLongA" (hWnd As HWND, nIndex As Long) As LONG_PTR
    9 Declare Function _System_SetWindowLongPtr Lib "user32" Alias "SetWindowLongA" (hWnd As HWND, nIndex As Long, l As LONG_PTR) As LONG_PTR
     8Declare Function _System_GetWindowLongPtr Lib "user32" Alias _FuncName_GetWindowLong (hWnd As HWND, nIndex As Long) As LONG_PTR
     9Declare Function _System_SetWindowLongPtr Lib "user32" Alias _FuncName_SetWindowLong (hWnd As HWND, nIndex As Long, l As LONG_PTR) As LONG_PTR
    1010#endif
    1111Declare Function _System_GetParent Lib "user32" Alias "GetParent" (hWnd As HWND) As HWND
     
    1818Declare Function _System_ValidateRgn Lib "user32" Alias "ValidateRgn" (hWnd As HWND, hRgn As HRGN) As BOOL
    1919Declare Function _System_BeginPaint Lib "user32" Alias "BeginPaint" (hWnd As HWND, ByRef ps As PAINTSTRUCT) As HDC
    20 Declare Function _System_EndPaint Lib "user32" Alias "EndPaint" (hWnd As HWND, ByRef lpPaint As PAINTSTRUCT) As HDC
    21 Declare Function _System_ClientToScreen Lib "user32" Alias "ClientToScreen" (hWnd As HWND, ByRef lpPoint As POINTAPI) As BOOL
    22 Declare Function _System_ScreenToClient Lib "user32" Alias "ScreenToClient" (hWnd As HWND, ByRef lpPoint As POINTAPI) As BOOL
     20Declare Function _System_EndPaint Lib "user32" Alias "EndPaint" (hWnd As HWND, ByRef ps As PAINTSTRUCT) As HDC
     21Declare Function _System_ClientToScreen Lib "user32" Alias "ClientToScreen" (hWnd As HWND, ByRef Point As POINTAPI) As BOOL
     22Declare Function _System_ScreenToClient Lib "user32" Alias "ScreenToClient" (hWnd As HWND, ByRef Point As POINTAPI) As BOOL
    2323Declare Function _System_CreateCaret Lib "user32" Alias "CreateCaret" (hWnd As HWND, hBitmap As HBITMAP, nWidth As Long, nHeight As Long) As BOOL
    2424Declare Function _System_HideCaret Lib "user32" Alias "HideCaret" (hWnd As HWND) As BOOL
     
    2828Declare Function _System_IsWindow Lib "user32" Alias "IsWindow" (hWnd As HWND) As BOOL
    2929Declare Function _System_Isiconic Lib "user32" Alias "Isiconic" (hWnd As HWND) As BOOL
    30 Declare Function _System_GetClientRect Lib "user32" Alias "GetClientRect" (hWnd As HWND, ByRef lpRect As RECT) As BOOL
     30Declare Function _System_GetClientRect Lib "user32" Alias "GetClientRect" (hWnd As HWND, ByRef Rect As RECT) As BOOL
    3131
    3232Class WindowHandle
     
    4141    End Sub
    4242
    43     Sub WindowHandle(ByRef wnd As WindowHandle)
     43    Sub WindowHandle(wnd As WindowHandle)
    4444        hwnd = wnd.hwnd
    4545    End Sub
     
    117117    End Function
    118118
    119     Const Function GetClassName(className As PSTR, maxCount As Long) As Long
     119    Const Function GetClassName(className As PTSTR, maxCount As Long) As Long
    120120        Return GetClassName(className, maxCount)
    121121    End Function
     
    145145    End Function
    146146
    147     Const Function GetDlgItemText(idDlgItem As Long, ps As PSTR, maxCount As Long) As Long
     147    Const Function GetDlgItemText(idDlgItem As Long, ps As PTSTR, maxCount As Long) As Long
    148148        Return GetDlgItemText(hwnd, idDlgItem, ps, maxCount)
    149149    End Function
     
    158158    End Function
    159159
    160     Const Function GetProp(psz As PCSTR) As HANDLE
     160    Const Function GetProp(str As String) As HANDLE
     161        Return GetProp(hwnd, ToTCStr(str))
     162    End Function
     163
     164    Const Function GetProp(psz As PCTSTR) As HANDLE
    161165        Return GetProp(hwnd, psz)
    162166    End Function
    163167
    164168    Const Function GetProp(atom As ATOM) As HANDLE
    165         Return GetProp(hwnd, atom As ULONG_PTR As PCSTR)
     169        Return GetProp(hwnd, atom As ULONG_PTR As PCTSTR)
    166170    End Function
    167171
     
    202206    End Function
    203207
    204     Const Function GetText(ps As PSTR, maxCount As Long) As Boolean
     208    Const Function GetText(ps As PTSTR, maxCount As Long) As Boolean
    205209        Return GetWindowText(ps, maxCount) As Boolean
    206210    End Function
     
    215219
    216220    Const Function GetWindowProcessThreadId(ByRef processId As DWord) As DWord
    217         Return GetWindowProcessThreadId(hwnd, processId)
     221        Return GetWindowProcessThreadId(hwnd, VarPtr(processId))
    218222    End Function
    219223
     
    294298    End Function
    295299
    296     Const Function MessageBox(text As PCSTR, caption As PCSTR, uType As DWord) As Long
     300    Const Function MessageBox(text As PCTSTR, caption As PCTSTR, uType As DWord) As Long
    297301        Return MessageBox(hwnd, text, caption, uType)
    298302    End Function
    299303
    300     Const Function MessageBox(text As PCSTR, caption As PCSTR) As Long
     304    Const Function MessageBox(text As PCTSTR, caption As PCTSTR) As Long
    301305        Return MessageBox(hwnd, text, caption, MB_OK)
    302306    End Function
    303307
    304     Const Function MessageBox(text As PCSTR) As Long
     308    Const Function MessageBox(text As PCTSTR) As Long
    305309        Return MessageBox(hwnd, text, 0, MB_OK)
    306310    End Function
     
    350354    End Function
    351355
    352     Function RemoveProp(psz As PCSTR) As HANDLE
     356    Function RemoveProp(str As String) As HANDLE
     357        Return RemoveProp(hwnd, ToTCStr(str))
     358    End Function
     359
     360    Function RemoveProp(psz As PCTSTR) As HANDLE
    353361        Return RemoveProp(hwnd, psz)
    354362    End Function
    355363
    356364    Function RemoveProp(atom As ATOM) As HANDLE
    357         Return RemoveProp(hwnd, atom As ULONG_PTR As PCSTR)
     365        Return RemoveProp(hwnd, atom As ULONG_PTR As PCTSTR)
    358366    End Function
    359367
     
    386394    End Function
    387395
    388     Function SetDlgItemText(idDlgItem As Long, psz As PCSTR) As Boolean
     396    Function SetDlgItemText(idDlgItem As Long, psz As PCTSTR) As Boolean
    389397        Return SetDlgItemText(hwnd, idDlgItem, psz) As Boolean
    390398    End Function
     
    414422    End Function
    415423
    416     Function SetProp(psz As PCSTR, hData As HANDLE) As Boolean
     424    Function SetProp(str As String, hData As HANDLE) As Boolean
     425        Return SetProp(hwnd, ToTCStr(str), hData) As Boolean
     426    End Function
     427
     428    Function SetProp(psz As PCTSTR, hData As HANDLE) As Boolean
    417429        Return SetProp(hwnd, psz, hData) As Boolean
    418430    End Function
    419431
    420432    Function SetProp(atom As ATOM, hData As HANDLE) As Boolean
    421         Return SetProp(atom As ULONG_PTR As PCSTR, hData) As Boolean
     433        Return SetProp(atom As ULONG_PTR As PCTSTR, hData) As Boolean
    422434    End Function
    423435
     
    468480    End Function
    469481
    470     Function SetText(psz As PCSTR) As Boolean
     482    Function SetText(psz As PCTSTR) As Boolean
    471483        Return SetWindowText(hwnd, psz) As Boolean
     484    End Function
     485
     486    Function SetText(str As String) As Boolean
     487        Return SetWindowText(hwnd, ToTCStr(str)) As Boolean
    472488    End Function
    473489
     
    682698    End Sub
    683699
     700    Const Function Prop(str As String) As HANDLE
     701        Return GetProp(str)
     702    End Function
     703
     704    Const Function Prop(psz As PCTSTR) As HANDLE
     705        Return GetProp(psz)
     706    End Function
     707
     708    Const Function Prop(atom As ATOM) As HANDLE
     709        Return GetProp(atom)
     710    End Function
     711
     712    Sub Prop(str As PCTSTR, h As HANDLE)
     713        SetProp(str, h)
     714    End Sub
     715
     716    Sub Prop(psz As PCTSTR, h As HANDLE)
     717        SetProp(psz, h)
     718    End Sub
     719
     720    Sub Prop(atom As ATOM, h As HANDLE)
     721        SetProp(atom, h)
     722    End Sub
     723
    684724    Const Function Text() As String
    685         With Text
    686             .ReSize(GetWindowTextLength(hwnd))
    687             .ReSize(GetWindowText(hwnd, .Chars, .Length + 1))
    688         End With
    689     End Function
    690 
    691     Sub Text(newText As PCSTR)
     725        Dim size = GetWindowTextLength(hwnd) + 1
     726        Dim p = _System_malloc(SizeOf (TCHAR) * size) As PTSTR
     727        Dim length = GetWindowText(hwnd, p, size)
     728        Return New String(p, length As SIZE_T)
     729    End Function
     730
     731    Sub Text(newText As String)
     732        SetWindowText(hwnd, ToTCStr(newText))
     733    End Sub
     734
     735    Sub Text(newText As PCTSTR)
    692736        SetWindowText(hwnd, newText)
    693737    End Sub
     
    740784End Class
    741785
    742 #endif '__WINDOWSHANDLE_SBP__
     786#endif '__WINDOWS_WINDOWHANDLE_SBP__
Note: See TracChangeset for help on using the changeset viewer.