问题:函数如下:在回调函数LineTimeup1中由窗口句柄获Local窗口客户区dc
但是应该如何调用DrawLine()函数,我知道不能这样调用,因为在别的函数中
是用 CPaintDC dc(this);处理的;但是在回调函数中不能由这个方法获得该窗口的dc;
但是应该怎么样调用?而且从出错的信息来看,回调函数不能这样调用该函数。什么回事情呢?
大家给我看看:void CALLBACK CChildwinWnd::LineTimeup1(HWND hWnd,UINT nMsg,UINT nIDEvent,DWORD dwTime)
{
pWnd=CWnd::FindWindow(NULL,"Local");
     
if(pWnd == NULL)

{
AfxMessageBox("未找到显示窗口,请注意启动窗口");
}
else
{

CClientDC dc(pWnd);
DrawLine(&dc);//这里出问题了
}}
void    CChildwinWnd::DrawLine( CDC *dc)
{
//画东西
}
--------------------Configuration: Sma - Win32 Debug--------------------
Compiling...
ChildwinWnd.cpp
C:\Documents and Settings\Administrator\桌面\Sma\ChildwinWnd.cpp(950) : error C2352: 'CChildwinWnd::DrawLine' : illegal call of non-static member function
        c:\documents and settings\administrator\桌面\sma\childwinwnd.h(26) : see declaration of 'DrawLine'
Error executing cl.exe.Sma.exe - 1 error(s), 0 warning(s)
函数定义:(CChildwinWnd.h中定义,CChildwinWnd.ccp中实现)
class CChildwinWnd : public CFrameWnd
{
DECLARE_DYNCREATE(CChildwinWnd)
protected:
CChildwinWnd();           // protected constructor used by dynamic creation// Attributes
public:

void    DrawLine( CDC *pdc);
static void CALLBACK LineTimeup1(HWND hWnd,UINT nMsg,UINT nIDEvent,DWORD dwTime);