18,363
社区成员




#ifndef __SPCLIENT_H__
#define __SPCLIENT_H__
class IReportCallback
{
public:
virtual bool OnReportSendByte(int iSum)=0;
virtual bool OnReadyToSend()=0;
};
// 这么多0 是不是意思函数没有完成?
class ISPClient
{
public:
virtual bool SetSPIP_PORT(char* szIP, int iPort)=0;
virtual bool Start()=0;
virtual bool Stop()=0;
virtual bool SendRegister(char* szChanName, int iUserID, char* szPassWor/*md5 len*/, char* pChanData, int iDataLen)=0;
virtual bool SendBlock(void* pBlock, int iBlockNum, int iOffset,int iLen)=0;
//
virtual bool SetCallback(IReportCallback* pCallback)=0;
};
ISPClient* CreaterSPClient(void);
void DeleteSPClient(void* pVoid);
#endif
void CliveStreamDlg::OnBnClickedButtonStart()
{
UpdateData(true);
m_bOnReady = false;
m_pISPClient = CreaterSPClient();
m_pISPClient->SetSPIP_PORT(m_strSPAddr.GetBuffer(m_strSPAddr.GetLength()), m_spPort);
m_pISPClient->Start();
m_pISPClient->SetCallback((IReportCallback*)this);
//上面这句注释就不出错了,但是我按f12看到的定义是virtual bool SetCallback(IReportCallback* pCallback)=0;
// 这个函数是怎么工作的啊,我不知道怎么处理。
}
int __cdecl _close (
int fh
)
{
int r; /* return value */
/* validate file handle */
_CHECK_FH_CLEAR_OSSERR_RETURN( fh, EBADF, -1 );
_VALIDATE_CLEAR_OSSERR_RETURN((fh >= 0 && (unsigned)fh < (unsigned)_nhandle), EBADF, -1);
_VALIDATE_CLEAR_OSSERR_RETURN((_osfile(fh) & FOPEN), EBADF, -1);
_lock_fh(fh); /* lock file */
__try {
if ( _osfile(fh) & FOPEN )
r = _close_nolock(fh);
else {
errno = EBADF;
r = -1;
_ASSERTE(("Invalid file descriptor. File possibly closed by a different thread",0));
}
}
__finally {
_unlock_fh(fh); /* unlock the file */
}
return r;
}