- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
for (DWORD CurItem=0; CurItem<dwNumItems; CurItem++)
{
switch (CurItem)
{
case 0:
description.LoadString(IDS_OPC_PROP_CDT);
pPropertyIDs[CurItem] = OPC_PROP_CDT;
pDescriptions[CurItem] = OpcStrDup(description);
pDataTypes[CurItem] = VT_I2;
break;
case 1:
description.LoadString(IDS_OPC_PROP_VALUE);
pPropertyIDs[CurItem] = OPC_PROP_VALUE;
pDescriptions[CurItem] = OpcStrDup(description);
pDataTypes[CurItem] = pDATag->m_value.vt;
break;
case 2:
description.LoadString(IDS_OPC_PROP_QUALITY); //Item Quality
pPropertyIDs[CurItem] = OPC_PROP_QUALITY;
pDescriptions[CurItem] = OpcStrDup(description);
pDataTypes[CurItem] = VT_I2;
break;
case 3:
description.LoadString(IDS_OPC_PROP_TIME); //Item Timestamp
pPropertyIDs[CurItem] = OPC_PROP_TIME;
pDescriptions[CurItem] = OpcStrDup(description);
pDataTypes[CurItem] = VT_DATE;
break;
case 4:
description.LoadString(IDS_OPC_PROP_RIGHTS); //Item Access Rights
pPropertyIDs[CurItem] = OPC_PROP_RIGHTS;
pDescriptions[CurItem] = OpcStrDup (description);
pDataTypes[CurItem] = VT_I4;
break;
case 5:
description.LoadString(IDS_OPC_PROP_DESC); //Item Description
pPropertyIDs[CurItem] = OPC_PROP_DESC;
pDescriptions[CurItem] = OpcStrDup(description);
pDataTypes[CurItem] = VT_BSTR;
break;
case 6:
description.LoadString(IDS_OPC_PROP_SCANRATE); //Item ScanRate
pPropertyIDs[CurItem] = OPC_PROP_SCANRATE;
pDescriptions[CurItem] = OpcStrDup(description);
pDataTypes[CurItem] = VT_R4;
break;
/////////////////////////////////////////////////////////////////////////
}
}
ctm 20.09.2011 11:57 # 0
и если не умеют, имхо даже написать
description.LoadString(IDS_OPC_PROP_CDT) ;
pPropertyIDs[0] = OPC_PROP_CDT;
pDescriptions[0] = OpcStrDup(description);
pDataTypes[0] = VT_I2;
description.LoadString(IDS_OPC_PROP_VALU E);
pPropertyIDs[1] = OPC_PROP_VALUE;
...
будет лучше, ибо это нагляднее.
defecate-plusplus 20.09.2011 12:20 # 0
получится
mydata[0].init(IDS_OPC_PROP_CDT, OPC_PROP_CDT, VT_I2);
mydata[1].init(IDS_OPC_PROP_VALUE, OPC_PROP_VALUE, pDATag->m_value.vt);
//....
ctm 21.09.2011 10:57 # 0
но ведь не умеют!
Dummy00001 20.09.2011 14:07 # 0
guest8 09.04.2019 11:32 # −999
bdevnameless 25.08.2021 19:25 # 0