Ignore:
Timestamp:
Aug 21, 2008, 11:04:42 AM (16 years ago)
Author:
イグトランス (egtra)
Message:

[601][602]でのコミットし忘れ分と細かい修正

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/Windows.ab

    r599 r603  
    4747End Namespace
    4848
     49Function HResultToString(hr As HRESULT) As String
     50    Dim pszMsg As PCSTR
     51    FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER Or FORMAT_MESSAGE_FROM_SYSTEM Or FORMAT_MESSAGE_IGNORE_INSERTS,
     52        0, hr, LANG_USER_DEFAULT, VarPtr(pszMsg) As PTSTR, 0, 0)
     53    If pszMsg <> 0 Then
     54        HResultToString = New String(pszMsg)
     55        LocalFree(pszMsg)
     56    End If
     57End Function
    4958
    5059/*!
     
    6877    */
    6978    Sub WindowsException(hr As HRESULT)
    70         Exception(hresultToString(hr))
     79        Exception(HResultToString(hr))
    7180        HResult = hr
    7281    End Sub
     
    98107    End Sub
    99108Private
    100     Static Function hresultToString(hr As HRESULT) As String
    101         Dim pszMsg As PCSTR
    102         FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER Or FORMAT_MESSAGE_FROM_SYSTEM Or FORMAT_MESSAGE_IGNORE_INSERTS,
    103             0, hr, LANG_USER_DEFAULT, VarPtr(pszMsg) As PTSTR, 0, 0)
    104         If pszMsg <> 0 Then
    105             hresultToString = New String(pszMsg)
    106             LocalFree(pszMsg)
    107         End If
    108     End Function
    109109End Class
    110110
Note: See TracChangeset for help on using the changeset viewer.