error C2228: left of '.GetLength' must have class/struct/union type问题
--------------------Configuration: VC - Win32 Debug--------------------
Compiling...
Hard.cpp
C:\Documents and Settings\Administrator\桌面\SDK_DSO3202A\Demo\VC\Hard.cpp(371) : error C2228: left of '.GetLength' must have class/struct/union type
C:\Documents and Settings\Administrator\桌面\SDK_DSO3202A\Demo\VC\Hard.cpp(373) : error C2228: left of '.GetLength' must have class/struct/union type
C:\Documents and Settings\Administrator\桌面\SDK_DSO3202A\Demo\VC\Hard.cpp(378) : error C2228: left of '.GetLength' must have class/struct/union type
执行 cl.exe 时出错.
Hard.obj - 1 error(s), 0 warning(s)
代码:void CHard::CollectData()
{
USHORT nReturn;
if(m_bStartNormalCollect == TRUE)
{
//Start Collecting
nReturn = dsoHMStartCollectData(m_nDeviceIndex,0);
//Clear Flag
m_bStartNormalCollect = FALSE;
//Clear
m_nWaitTimes = 0;
}
//Get Collected State
m_nCollectState = dsoHMGetYTNormalCaptureState(m_nDeviceIndex);
if(m_nCollectState == 7)
{
//Read Collect Data
int i;
USHORT* pReadData[4];
ULONG nDataLen = m_stControl.nReadDataLen;
for(i=0;i<MAX_CH_NUM;i++)
{
pReadData[i] = new USHORT[nDataLen];
}
if(m_stControl.nTimeDIV > MAX_INSERT_TIMEDIV)
{
//Normal Collect,No Insert Data
m_nReadOK = dsoHMGetNormalData(m_nDeviceIndex,pReadData[0],pReadData[1],pReadData[2],pReadData[3],&m_stControl,&m_stRelayControl);
CFile file;
file.Open( "D:\\shuju.txt",CFile::modeCreate|CFile::modeNoTruncate|CFile::modeReadWrite);
file.Write(pReadData[0],pReadData[0].GetLength());
file.SeekToEnd(); //将指针移至文件末尾进行追加
file.Write(pReadData[0],pReadData[0].GetLength());
file.Close();
try
{
CFile file(_T("D:\\shuju.txt"), CFile::modeCreate | CFile::modeWrite);
file.Write(pReadData[0], pReadData[0].GetLength()*sizeof(TCHAR));
file.Close();
}
catch(CException* e)
{
e->ReportError();
e->Delete();
}
}