Changeset 603 for trunk/ab5.0/ablib/src/Classes/ActiveBasic
- Timestamp:
- Aug 21, 2008, 11:04:42 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/Windows.ab
r599 r603 47 47 End Namespace 48 48 49 Function 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 57 End Function 49 58 50 59 /*! … … 68 77 */ 69 78 Sub WindowsException(hr As HRESULT) 70 Exception( hresultToString(hr))79 Exception(HResultToString(hr)) 71 80 HResult = hr 72 81 End Sub … … 98 107 End Sub 99 108 Private 100 Static Function hresultToString(hr As HRESULT) As String101 Dim pszMsg As PCSTR102 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 Then105 hresultToString = New String(pszMsg)106 LocalFree(pszMsg)107 End If108 End Function109 109 End Class 110 110
Note:
See TracChangeset
for help on using the changeset viewer.