|
|
|
OleVariant & VarToStr & Could not convert variant of type (Dispatch) into type (String)
|
|||
|---|---|---|---|
|
#18+
Доброго дня, жентельмены. Вытаскиваю инфу о мониторах из WMI. Спотыкаюсь на VarToStr(lItem.Properties_.Item(AProperty[pCount], 0)); Вылетает Excepation с мессаджем Could not convert variant of type (Dispatch) into type (String) Как победить? Как узнать что именно в данный момент лежит в lItem.Properties_.Item(AProperty[pCount], 0)? И как правильно обработать это? Мой протокол: -- Monitor -- ManufacturerName = Could not convert variant of type (Dispatch) into type (String) ProductCodeID = Could not convert variant of type (Dispatch) into type (String) SerialNumberID = Could not convert variant of type (Dispatch) into type (String) UserFriendlyName = Could not convert variant of type (Dispatch) into type (String) UserFriendlyNameLength = 13 WeekOfManufacture = 28 YearOfManufacture = 2012 Протокол WMICodeCreator ----------------------------------- WmiMonitorID instance ----------------------------------- Active: Истина InstanceName: DISPLAY\AOC1941\4&2d69ced9&0&UID50531072_0 ManufacturerName: 65,79,67,0,0,0,0,0,0,0,0,0,0,0,0,0 ProductCodeID: 49,57,52,49,0,0,0,0,0,0,0,0,0,0,0,0 SerialNumberID: 68,76,85,67,55,72,65,48,49,52,50,52,53,0,0,0 UserFriendlyName: 49,57,52,49,0,0,0,0,0,0,0,0,0 UserFriendlyNameLength: 13 WeekOfManufacture: 28 YearOfManufacture: 2012 ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 24.12.2019, 12:16 |
|
||
|
OleVariant & VarToStr & Could not convert variant of type (Dispatch) into type (String)
|
|||
|---|---|---|---|
|
#18+
LocksmithPC ManufacturerName = Could not convert variant of type (Dispatch) into type (String) ProductCodeID = Could not convert variant of type (Dispatch) into type (String) SerialNumberID = Could not convert variant of type (Dispatch) into type (String) UserFriendlyName = Could not convert variant of type (Dispatch) into type (String) Массивы, скорее всего. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 24.12.2019, 12:49 |
|
||
|
OleVariant & VarToStr & Could not convert variant of type (Dispatch) into type (String)
|
|||
|---|---|---|---|
|
#18+
wadman Массивы, скорее всего. Вопрос, как на ходу узнать массив ли это, и как вынимать данные из него? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 24.12.2019, 13:14 |
|
||
|
OleVariant & VarToStr & Could not convert variant of type (Dispatch) into type (String)
|
|||
|---|---|---|---|
|
#18+
VarType() ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 24.12.2019, 13:16 |
|
||
|
OleVariant & VarToStr & Could not convert variant of type (Dispatch) into type (String)
|
|||
|---|---|---|---|
|
#18+
Ghost Writer VarType() VarTypeAsText(VarType(lValue)) утверждает, что там Dispatch ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 24.12.2019, 13:24 |
|
||
|
OleVariant & VarToStr & Could not convert variant of type (Dispatch) into type (String)
|
|||
|---|---|---|---|
|
#18+
... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 24.12.2019, 13:43 |
|
||
|
OleVariant & VarToStr & Could not convert variant of type (Dispatch) into type (String)
|
|||
|---|---|---|---|
|
#18+
Видел. Там серийников нет. Я вынимаю из root\WMI WmiMonitorID ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 24.12.2019, 13:46 |
|
||
|
OleVariant & VarToStr & Could not convert variant of type (Dispatch) into type (String)
|
|||
|---|---|---|---|
|
#18+
LocksmithPC Видел. Там серийников нет. Я вынимаю из root\WMI WmiMonitorID Мне выдает немного более понятную ошибку: First chance exception at $76B85EF8. Exception class EVariantTypeCastError with message 'Could not convert variant of type (Array Variant) into type (String)'. Process Project1.exe (12452) ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 24.12.2019, 14:07 |
|
||
|
OleVariant & VarToStr & Could not convert variant of type (Dispatch) into type (String)
|
|||
|---|---|---|---|
|
#18+
wadman Мне выдает немного более понятную ошибку: First chance exception at $76B85EF8. Exception class EVariantTypeCastError with message 'Could not convert variant of type (Array Variant) into type (String)'. Process Project1.exe (12452) Delphi которая? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 24.12.2019, 14:15 |
|
||
|
OleVariant & VarToStr & Could not convert variant of type (Dispatch) into type (String)
|
|||
|---|---|---|---|
|
#18+
LocksmithPC wadman Мне выдает немного более понятную ошибку: First chance exception at $76B85EF8. Exception class EVariantTypeCastError with message 'Could not convert variant of type (Array Variant) into type (String)'. Process Project1.exe (12452) Delphi которая? 2007 ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 24.12.2019, 14:19 |
|
||
|
OleVariant & VarToStr & Could not convert variant of type (Dispatch) into type (String)
|
|||
|---|---|---|---|
|
#18+
Код: pascal 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 24.12.2019, 15:52 |
|
||
|
OleVariant & VarToStr & Could not convert variant of type (Dispatch) into type (String)
|
|||
|---|---|---|---|
|
#18+
_Vasilisk_ Код: pascal 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. Код: pascal 1. 2. 3. 4. 5. 6. 7. 8. 9. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 24.12.2019, 16:24 |
|
||
|
OleVariant & VarToStr & Could not convert variant of type (Dispatch) into type (String)
|
|||
|---|---|---|---|
|
#18+
LocksmithPC Код: pascal 1. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 24.12.2019, 16:27 |
|
||
|
OleVariant & VarToStr & Could not convert variant of type (Dispatch) into type (String)
|
|||
|---|---|---|---|
|
#18+
_Vasilisk_ И что? Вопрос в чем? Докуда инкрементить 0? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 24.12.2019, 16:40 |
|
||
|
OleVariant & VarToStr & Could not convert variant of type (Dispatch) into type (String)
|
|||
|---|---|---|---|
|
#18+
Вопщем, победа. Код: pascal 1. 2. 3. 4. 5. 6. 7. 8. Всем спасибо ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 24.12.2019, 16:54 |
|
||
|
OleVariant & VarToStr & Could not convert variant of type (Dispatch) into type (String)
|
|||
|---|---|---|---|
|
#18+
LocksmithPC Вопщем, победа. Код: pascal 1. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 24.12.2019, 16:59 |
|
||
|
OleVariant & VarToStr & Could not convert variant of type (Dispatch) into type (String)
|
|||
|---|---|---|---|
|
#18+
_Vasilisk_ Код: pascal 1. Не, не глотает :( ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 24.12.2019, 17:46 |
|
||
|
OleVariant & VarToStr & Could not convert variant of type (Dispatch) into type (String)
|
|||
|---|---|---|---|
|
#18+
LocksmithPC Не, не глотает :( Код: pascal 1. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 24.12.2019, 18:00 |
|
||
|
OleVariant & VarToStr & Could not convert variant of type (Dispatch) into type (String)
|
|||
|---|---|---|---|
|
#18+
_Vasilisk_ Почему? А если так Код: pascal 1. [DCC Error] *.dpr(152): E2036 Variable required ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 24.12.2019, 18:15 |
|
||
|
OleVariant & VarToStr & Could not convert variant of type (Dispatch) into type (String)
|
|||
|---|---|---|---|
|
#18+
Нашёл пользу с топика. Проверил пример из SO (пофикшенный) на своём компе. Выдало: Device ID DesktopMonitor1 Caption Generic PnP Monitor Description Generic PnP Monitor Manufacturer (Standard monitor types) Type Generic PnP Monitor ScreenHeight 1080 ScreenWidth 1920 ----------------------------------------------- Device ID DesktopMonitor2 Caption Generic PnP Monitor Description Generic PnP Monitor Manufacturer (Standard monitor types) Type Generic PnP Monitor ScreenHeight ScreenWidth ----------------------------------------------- пришлось попросить винду обновить драйвера (странно что сама не догадалась при изменении конфигурации мониторов) теперь: Device ID DesktopMonitor1 Caption SyncMaster P2250(G)/P22500(G),Magic P2250G(Digital) Description SyncMaster P2250(G)/P22500(G),Magic P2250G(Digital) Manufacturer Samsung Type SyncMaster P2250(G)/P22500(G),Magic P2250G(Digital) ScreenHeight 1080 ScreenWidth 1920 ----------------------------------------------- Device ID DesktopMonitor2 Caption BenQ LCD Description BenQ LCD Manufacturer BenQ Type BenQ LCD ScreenHeight ScreenWidth ----------------------------------------------- Непонятно почему на втором мониторе разрешение дисплея не кажет. Может из-за 4К? Кто-нить на мультимониторной может проверить данные о разрешении второго монитора? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 24.12.2019, 23:25 |
|
||
|
OleVariant & VarToStr & Could not convert variant of type (Dispatch) into type (String)
|
|||
|---|---|---|---|
|
#18+
white_nigger Кто-нить на мультимониторной может проверить данные о разрешении второго монитора? Код: plaintext 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. При этом разрешение 1600х900 у первого монитора, а не у SyncMaster. И первому монитору винда сама обновлять драйвера не хочет, а искать мне влом ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 26.12.2019, 15:12 |
|
||
|
OleVariant & VarToStr & Could not convert variant of type (Dispatch) into type (String)
|
|||
|---|---|---|---|
|
#18+
_Vasilisk_ При этом разрешение 1600х900 у первого монитора, а не у SyncMaster. И первому монитору винда сама обновлять драйвера не хочет, а искать мне влом ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 26.12.2019, 15:31 |
|
||
|
OleVariant & VarToStr & Could not convert variant of type (Dispatch) into type (String)
|
|||
|---|---|---|---|
|
#18+
_Vasilisk_ искать мне влом ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 26.12.2019, 16:18 |
|
||
|
OleVariant & VarToStr & Could not convert variant of type (Dispatch) into type (String)
|
|||
|---|---|---|---|
|
#18+
_Vasilisk_ _Vasilisk_ искать мне влом Номера в настройках точно такие, как ожидаются? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 26.12.2019, 16:42 |
|
||
|
OleVariant & VarToStr & Could not convert variant of type (Dispatch) into type (String)
|
|||
|---|---|---|---|
|
#18+
wadman Номера в настройках точно такие, как ожидаются? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 26.12.2019, 16:56 |
|
||
|
|

start [/forum/topic.php?fid=58&msg=39908536&tid=2038731]: |
0ms |
get settings: |
6ms |
get forum list: |
19ms |
check forum access: |
3ms |
check topic access: |
3ms |
track hit: |
133ms |
get topic data: |
12ms |
get forum data: |
3ms |
get page messages: |
90ms |
get tp. blocked users: |
2ms |
| others: | 211ms |
| total: | 482ms |

| 0 / 0 |
