多文档中如何只刷新当前激活视图,而对其他视图保持,
我找过资料,好像使用InvalidateRect,但它只能指定一个CRect的区域,当视图移动或改变大小时还是会刷新。
请各位兄弟帮帮忙啊~~~~~

解决方案 »

  1.   

    ::SendMessage(pSpecifiedView->GetSaftHWnd(),WM_PAINT,(pSpecifiedViw->GetDC())->GetHDC(),0);
      

  2.   

    大哥, 能不能说详细点啊。。
    有错啊--------------------Configuration: dd7 - Win32 Debug--------------------
    Compiling...
    dd7View.cpp
    F:\study\vc\dd74\dd7\dd7View.cpp(240) : error C2039: 'GetSaftHWnd' : is not a member of 'CDd7View'
            f:\study\vc\dd74\dd7\dd7view.h(13) : see declaration of 'CDd7View'
    F:\study\vc\dd74\dd7\dd7View.cpp(240) : error C2039: 'GetHDC' : is not a member of 'CDC'
            c:\program files\microsoft visual studio\vc98\mfc\include\afxwin.h(636) : see declaration of 'CDC'
    Error executing cl.exe.dd7.exe - 2 error(s), 0 warning(s)
      

  3.   

    Sorry,Just I made a spelling mistake.Now write it again:
    ::SendMessage(pSpecifiedView->GetSafeHWnd(),WM_PAINT,(pSpecifiedViw->GetDC())->GetSafeHdc(),0);
      

  4.   

    谢谢大哥回答我的问题
    但是仍然有错,我的pView后箭头的函数都有了
    我得代码:::SendMessage(pView->GetSafeHwnd(),WM_PAINT,(pView->GetDC())->GetSafeHdc(),0);
    错误如下:
    --------------------Configuration: dd7 - Win32 Debug--------------------
    Compiling...
    dd7View.cpp
    F:\study\vc\dd74\dd7\dd7View.cpp(245) : error C2664: 'SendMessageA' : cannot convert parameter 3 from 'struct HDC__ *' to 'unsigned int'
            This conversion requires a reinterpret_cast, a C-style cast or function-style cast
    Error executing cl.exe.dd7.exe - 1 error(s), 0 warning(s)
      

  5.   

    把第三个参数强制类型转换:(WPARAM)((pSpecifiedViw->GetDC())->GetSafeHdc()),应该可以OK!万一还不行,就用NULL来代替!
      

  6.   

    错误是没了
    但是
    假设有A、B两个视图,他们基于一个文档,当A画完,B画另一个与A不同的视图时,
    若移动B视图会调用WM_ONPAINT,A仍会刷新。
    你说的方法没有能把A保持住。请问还有什么办法啊
    UpdateAllViews(this,0,NULL)也不行啊。。
    分送上,反正我也没有什么用。