Ignore:
Timestamp:
Sep 21, 2008, 2:06:46 AM (16 years ago)
Author:
イグトランス (egtra)
Message:

Console.Title(取得側)が正しく動かないバグを除去

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ab5.0/ablib/src/Classes/System/Console.ab

    r627 r629  
    240240            Exit Sub
    241241        Else
    242             SetConsoleTitle(StrPtr(title))
     242            SetConsoleTitle(ToTCStr(title))
    243243        End If
    244244    End Sub
    245245    Static Function Title() As String
    246         Dim sb = New Text.StringBuilder(24500*SizeOf(Char))
    247246        If Console.hconsoleout =NULL Then
    248247            Return ""
    249248        Else
    250             GetConsoleTitle(sb.__Chars(),sb.Length())
     249            Dim sb = New Text.StringBuilder
     250            sb.Length = 24500
     251            Dim ret = GetConsoleTitle(StrPtr(sb),sb.Length())
     252            If ret = 0 Then
     253                Dim error = GetLastError()
     254                If error <> ERROR_SUCSESS Then
     255                    ActiveBasic.Windows.ThrowWithErrorCode(error, "Console.Title")
     256                End If
     257            End If
     258            sb.Length = ret
     259            Return sb.ToString()
    251260        End If
    252261    End Function
Note: See TracChangeset for help on using the changeset viewer.