如何在一个线程中向一个视图发送消息? 我想在一个文档中定一个工作线程向一个视图用PostMessage发消息但现在不知怎样取得哪个视图的句柄? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 使用CDocument类的GetFirstViewPosition和GetNextView方法可以获得View的类的应用(和该Document相关联的)下面的代码是MSDN里的范例:POSITION pos = GetFirstViewPosition();CView* pFirstView = GetNextView( pos );// This example uses CDocument::GetFirstViewPosition// and GetNextView to repaint each view.void CMyDoc::OnRepaintAllViews(){ POSITION pos = GetFirstViewPosition(); while (pos != NULL) { CView* pView = GetNextView(pos); pView->UpdateWindow(); } }good luck POSITION pos=pDocument->GetFirstViewPosition(); while(pos!=NULL) { CYourView* pView = DYNAMIC_DOWNCAST(CYourView,m_pDocument->GetNextView(pos)); if(pView) { ... } } 异步SOCKET 服务器 怎么得到每个退出的客户端的IP 能在hook的回调函数里再hook吗? 如何修改主机名 菜鸟求教:用户界面线程结束的问题 我用CAsyncSocket编聊天程序的问题 如何用ATL实现Windows Shell中的ShellFolderTree. c runtime library是什么意思请高手解释 用 WriteFile向串口写数据时,如何能非常准确的知道数据已经写完了? VC中如何使用sleep()函数? byte类型和unsigned char WM_TIMER用什么类型挂钩可以拦截到?WM_GETMESSAGE好像不行 我的多现程怎么不能并发执行呢?
CView* pFirstView = GetNextView( pos );
// This example uses CDocument::GetFirstViewPosition
// and GetNextView to repaint each view.
void CMyDoc::OnRepaintAllViews()
{
POSITION pos = GetFirstViewPosition();
while (pos != NULL)
{
CView* pView = GetNextView(pos);
pView->UpdateWindow();
}
}
good luck
while(pos!=NULL)
{
CYourView* pView = DYNAMIC_DOWNCAST(CYourView,m_pDocument->GetNextView(pos));
if(pView)
{
...
}
}