Changeset 192 for Include/system/string.sbp
- Timestamp:
- Mar 28, 2007, 10:29:58 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Include/system/string.sbp
r177 r192 36 36 Function GetStr(psz As PSTR, len As SIZE_T, ByRef wcs As PWSTR) As SIZE_T 37 37 If psz = 0 Then Return 0 38 Dim sizeWCS = MultiByteToWideChar(CP_THREAD_ACP, 0, psz, len, 0, 0) + 139 wcs = _System_AllocForConvertedString(SizeOf (WCHAR) * sizeWCS) As PWSTR40 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) 41 41 wcs[GetStr] = 0 42 42 End Function … … 70 70 Function GetStr(psz As PWSTR, len As SIZE_T, ByRef mbs As PSTR) As SIZE_T 71 71 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 PSTR74 GetStr = WideCharToMultiByte(CP_THREAD_ACP, 0, psz, len, mbs, sizeMBS, 0, 0) As SIZE_T72 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 75 75 mbs[GetStr] = 0 76 76 End Function
Note:
See TracChangeset
for help on using the changeset viewer.