线程中SetDlgItemText的一个小问题。高手帮帮忙。

jczff jczff 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
这是我的一个线程:UINT CFileTransferClientView::ThreadedGetFileFromRemoteSender(LPVOID pVoid)
{
CFileTransferClientView* pThis = (CFileTransferClientView*)pVoid;
AfxSocketInit(NULL); // make certain this is done somewhere in each thread (usually in InitInstance for main thread)
CSocket sockClient;
sockClient.Create();
sockClient.Connect( pThis->m_strTargetIP, PRE_AGREED_PORT ); // PRE_AGREED_PORT is #define'd as 8686
int dataLength, cbBytesRet, cbLeftToReceive; // used to monitor the progress of a receive operation
BYTE* recdData = NULL; // pointer to buffer for receiving data (memory is allocated after obtaining file size)
int pbInterval = 0; int curPB = 0; // progress bar variables
CFile destFile;
CFileException fe;
BOOL bFileIsOpen = FALSE;
cbLeftToReceive = sizeof( dataLength );
do
{
BYTE* bp = (BYTE*)(&dataLength) + sizeof(dataLength) - cbLeftToReceive;
cbBytesRet = sockClient.Receive( bp, cbLeftToReceive - simulate );
SetDlgItemText(IDC_EDIT1,"do");
}
while ( cbLeftToReceive > 0 );
return 0;
}
当我用到这一句SetDlgItemText(IDC_EDIT1,"do");
时,会出现
F:\FileTransferClientView.cpp(558) : error C2352: 'CWnd::SetDlgItemTextA' : illegal call of non-static member function
d:\program files\microsoft visual studio\vc98\mfc\include\afxwin.h(2156) : see declaration of 'SetDlgItemTextA'
搞不懂怎么会这样。
那我想实时修改文本框里面的内容,该怎么办呢
...全文

相关推荐

评论 5
收藏 已收藏
分享
返回顶部
jczff
进程/线程/DLL 15,466 成员 49,169 内容