求助 ! 我启动一个线程,在线程中获得一个(unsigned char *)类型的指针。 然后要把它指向的内容在控件CEdit中显示出来,我定义了一个成员变量m-OutText。 请问我要如何才能把指针指向的内容显示在对话框上? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 char* copy到m_outtext再UpdateData(FALSE)不就可以了? 我的成员变量定义为 CString 类的一个对象,我用 m_OutText = (LPCSTR)m_MeThread.Buffer; UpdateData(FALSE);编译可以通过,但是执行时显示出错。错误代码指向const CString& CString::operator=(LPCTSTR lpsz){******》 ASSERT(lpsz == NULL || AfxIsValidString(lpsz)); AssignCopy(SafeStrlen(lpsz), lpsz); return *this;} void CMyworkDlg::OnReadPipe() { if( m_MeThread.bInThread == TRUE) { return; } m_MeThread.testDlg = this; m_MeThread.uiLength = 16; strcpy(m_MeThread.pipe_name, (LPCSTR)"PIPE02"); strcpy(m_MeThread.driver_name, (LPCSTR)"D12TEST-0"); CWinThread * wt = AfxBeginThread( ReadPipe, // thread function &m_MeThread); // argument to thread function m_MeThread.hThread = wt->m_hThread; m_OutText = (LPCSTR)m_MeThread.Buffer; UpdateData(FALSE);}在ReadPipe中 Result = ReadFile(hFile, threadParam->Buffer, threadParam->uiLength, &nBytes, NULL); SetWindowExtEx 和SetViewportExtEx 的问题 谁有 <Windows网络编程之VC篇>的电子书 pcap_live_dump等win32扩展函数的返回的int值者有什么值啊? 已经完成视频的编码和解码,测试时使用的是TCP,很正常,但是点对点的传输效率太低,有好的方法吗? 这样的代码安排会有冲突么? 怎么得到outlook的收件人地址? 拆分窗口后,菜单命令的响应问题 完成端口,有必要么? 请教一下,有段程序看不明白,谢谢 关于UDP通讯问题 About DoDataExchange() 请各位大虾推荐几个比较好的vc网站!
m_OutText = (LPCSTR)m_MeThread.Buffer;
UpdateData(FALSE);
编译可以通过,但是执行时显示出错。错误代码指向
const CString& CString::operator=(LPCTSTR lpsz)
{
******》 ASSERT(lpsz == NULL || AfxIsValidString(lpsz));
AssignCopy(SafeStrlen(lpsz), lpsz);
return *this;
}
{
if( m_MeThread.bInThread == TRUE)
{
return;
} m_MeThread.testDlg = this;
m_MeThread.uiLength = 16;
strcpy(m_MeThread.pipe_name, (LPCSTR)"PIPE02");
strcpy(m_MeThread.driver_name, (LPCSTR)"D12TEST-0");
CWinThread * wt = AfxBeginThread(
ReadPipe, // thread function
&m_MeThread); // argument to thread function
m_MeThread.hThread = wt->m_hThread; m_OutText = (LPCSTR)m_MeThread.Buffer;
UpdateData(FALSE);
}在ReadPipe中
Result = ReadFile(hFile,
threadParam->Buffer,
threadParam->uiLength,
&nBytes,
NULL);