在一个线程(是个静态的)中调用SetDlgItemText(),出现如下错误,error C2352: 'CWnd::SetDlgItemTextA' : illegal call of non-static member function.请问各位大侠还有其他什么办法或者函数吗?
解决方案 »
- 关于CFindFile的问题
- 求微软 encrypt库的资料
- virtual AFX_MSGMAP* GetMessageMap() const;
- 一个关于bho的问题!
- 请教:如何控制经分割后的视图的大小?
- 《windows程序设计》问题,综合前几天的问题再发一问
- 一个让我头痛的问题,请高手赐教:我的程序编译成功,但是重复运行同一个函数几次就会抛出异常,求救!
- String &oprator=(String &)
- 关于COM的参数传递
- 我的VC6死了,各位大侠,救救我!解决立马给分!!
- DDX_Text( pDX, IDC_EDIT1,(int)m_pSet->m_name,5 );
- datagrid能结合下拉列表吗
试了一下是这样的:
error C2228: left of '.SetDlgItemTextA' must have class/struct/union type
{
while(true)
{
HWND handle = FindWindow(NULL,_T("Dialog"));
if (handle)
{
SetWindowText(handle, _T("现在是我想要显示的字符串"));
}
}
}void CMFCTestDlg::OnBnClickedOk()
{
HANDLE hThread = CreateThread ( NULL, 0, ServerThread, this, 0, NULL ) ;
CMyDlg myDlg;
myDlg.DoModal();
OnOK();
}
DWORD WINAPI ServerThread ( LPVOID lParam )
{
while(true)
{
HWND handle = FindWindow(NULL,_T("Dialog"));
if (handle)
{
HWND subHandle = FindWindowEx(handle, NULL, NULL, _T("static"));
SetWindowText(subHandle, _T("现在是我想要显示的字符串"));
}
}
}