Changeset 351 for trunk/Utilities/EnumerateAudioDevices/MainDialog.h
- Timestamp:
- Dec 3, 2014, 10:49:10 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Utilities/EnumerateAudioDevices/MainDialog.h
r11 r351 2 2 // Copyright (C) Roman Ryltsov, 2008-2011 3 3 // Created by Roman Ryltsov roman@alax.info 4 //5 // $Id$6 4 7 5 #pragma once … … 68 66 for(UINT nDeviceIndex = 0; nDeviceIndex < nDeviceCount; nDeviceIndex++) 69 67 _ATLTRY 70 {68 { 71 69 sText.AppendFormat(_T("Device %d:\r\n"), nDeviceIndex); 72 70 CComPtr<IMMDevice> pMmDevice; … … 1157 1155 if(sKeyName.IsEmpty()) 1158 1156 sKeyName = AtlFormatString(_T("%ls, %d"), _PersistHelper::StringFromIdentifier(Key.fmtid), Key.pid); 1157 #pragma region String Value 1159 1158 CString sValue; 1160 1159 HRESULT nChangeTypeResult = E_FAIL; … … 1176 1175 sValue += _T(", "); 1177 1176 CRoArrayT<CString> Array; 1178 if(Value.blob.cbSize <= 16) 1177 static const SIZE_T g_nMaximalSize = 128; 1178 if(Value.blob.cbSize <= g_nMaximalSize) 1179 1179 { 1180 1180 for(ULONG nIndex = 0; nIndex < Value.blob.cbSize; nIndex++) … … 1182 1182 } else 1183 1183 { 1184 for(ULONG nIndex = 0; nIndex < 8; nIndex++)1184 for(ULONG nIndex = 0; nIndex < g_nMaximalSize - 8; nIndex++) 1185 1185 _W(Array.Add(AtlFormatString(_T("%02X"), Value.blob.pBlobData[nIndex])) >= 0); 1186 1186 _W(Array.Add(_T("...")) >= 0); … … 1197 1197 break; 1198 1198 } 1199 #pragma region Variant as String 1199 1200 CComVariant vValue; 1200 1201 if(FAILED(nChangeTypeResult)) … … 1206 1207 sValue = _T("???"); 1207 1208 } 1208 sText.AppendFormat(_T("\t\t") _T("%s\t%s\t%d\r\n"), sKeyName, sValue, Value.vt); 1209 #pragma endregion 1210 #pragma endregion 1211 static const CEnumerationNameT<VARTYPE> g_pVarTypeMap[] = 1212 { 1213 #define A(x) { x, #x }, 1214 A(VT_EMPTY) 1215 A(VT_NULL) 1216 A(VT_I2) 1217 A(VT_I4) 1218 A(VT_R4) 1219 A(VT_R8) 1220 A(VT_CY) 1221 A(VT_DATE) 1222 A(VT_BSTR) 1223 A(VT_DISPATCH) 1224 A(VT_ERROR) 1225 A(VT_BOOL) 1226 A(VT_VARIANT) 1227 A(VT_UNKNOWN) 1228 A(VT_DECIMAL) 1229 A(VT_I1) 1230 A(VT_UI1) 1231 A(VT_UI2) 1232 A(VT_UI4) 1233 A(VT_I8) 1234 A(VT_UI8) 1235 A(VT_INT) 1236 A(VT_UINT) 1237 A(VT_VOID) 1238 A(VT_HRESULT) 1239 A(VT_PTR) 1240 A(VT_SAFEARRAY) 1241 A(VT_CARRAY) 1242 A(VT_USERDEFINED) 1243 A(VT_LPSTR) 1244 A(VT_LPWSTR) 1245 A(VT_RECORD) 1246 A(VT_INT_PTR) 1247 A(VT_UINT_PTR) 1248 A(VT_FILETIME) 1249 A(VT_BLOB) 1250 A(VT_STREAM) 1251 A(VT_STORAGE) 1252 A(VT_STREAMED_OBJECT) 1253 A(VT_STORED_OBJECT) 1254 A(VT_BLOB_OBJECT) 1255 A(VT_CF) 1256 A(VT_CLSID) 1257 A(VT_VERSIONED_STREAM) 1258 #undef A 1259 }; 1260 sText.Append(_StringHelper::Join<CString>(5, _T("\t"), 1261 _T(""), 1262 _T(""), 1263 sKeyName, 1264 sValue, 1265 FormatEnumerationT(g_pVarTypeMap, Value.vt), 1266 0) + _T("\r\n")); 1209 1267 } 1210 1268 _ATLCATCHALL()
Note: See TracChangeset
for help on using the changeset viewer.