Programming Manual 64
GetComInfo
Get com identifier index and amount from device hardware.
DWORD GetComInfo
{
int *nComSum,
LPCWSTR pComValue,
int *nComValueLen
}
Parameters
nComSum
[out] Receive the device com amount
pComValue
[out] The buffer to receive the device com identifier index
nComValueLen
[in/out] The pComValue buffer max size. If terminal com value length >
nComValueLen, the nComValueLen receive current com value length.
Returned Values
If the action succeeds, the returned value is E_FUNC_SUCCEED. If the action fails,
possible returned value is E_FUNC_ERROR, BT_ERR_INSUFFICIENT.
Remarks
If function return BT_ERR_INSUFFICIENT, nComValueLen will receive the com
value length of terminal.
Example
WCHAR * pComValue;
int nComSum = 0, nComValueLen = 10;
pComValue = new WCHAR[nComValueLen];
DWORD dwErr = GetComInfo(&nComSum, pComValue, & nComValueLen);
If(dwErr == BT_ERR_INSUFFICIENT){
Delete pComValue;
pComValue = new WCHAR[nComValueLen];
GetComInfo(&nComSum, pComValue, & nComValueLen);
}
Commentaires sur ces manuels