问题描述
- 串口通信关于 VARINAT的问题
-
VARINAT variant_inp;
COleSafeArray safearray_inp;
LONG len,k;
BYTE rxdata[2048];
CString strtemp;
if(m_ctrlComm.GetCommEvent()==2)
{
variant_inp=m_ctrlComm.GetInput();
safearray_inp=variant_inp;
len=safearray_inp.GetOneDimSize();
for(k=0;k<len;k++)
safearray_inp.GetElement(&k,rxdata+k);
for(k=0;k<len;k++)
{ BYTE bt=*(char*)(rxdata+k);
strtemp.Format("%c",bt);
m_strRXData+=strtemp;
}}
UpdateData(FALSE);
编译后出现error C2065: 'VARINAT' : undeclared identifier
'variant_inp' : undeclared identifier请教大神们怎么办
时间: 2025-01-24 23:20:41