我的程序如下
问题函数:
void DrawTitleText(HDC hdc,HWND hWnd,RECT rt,LPCTSTR str,COLORREF cl);
调用地方:
在中
void TGIWnd::InitWndView(HDC hdc)
{
        UpdateRect();
        DrawFrame(hdc,hWnd);
        DrawTitle(hdc,hWnd,TitleColor);
        DrawClient(hdc,hWnd);
        DrawTitleText(hdc,hWnd,TitleRect,(LPTSTR)TitleText,TitleTextColor);//这里没问题
        DrawMinBtn(hdc,hWnd,RGB(0,0,255),InMinBtn);
        DrawExtBtn(hdc,hWnd,RGB(0,0,255),InExtBtn);        
}
这里的代码不提示错误
在中
void TGIWnd::OnActive(WORD fActive)
{
if(fActive==WA_INACTIVE)
TitleColor=RGB(180,180,180);
    else
        TitleColor=RGB(64,64,64);
InvalidateRect(hWnd,&TitleRect,true);
HDC a;a=GetDC(hWnd);
DrawTitle(a,hWnd,TitleColor);

DrawTitleText(a,hWnd,TitleRect,TitleText,TitleTextColor);//注意,这里
//InitWndView(a);
UpdateWindow(hWnd);
ReleaseDC(hWnd,a);
}
当我把DrawTitleText函数屏蔽掉//DrawTitleText.程序正常运行,一调用就出现 "发送错误消息"对话匡AppName: test.exe  AppVer: 0.0.0.0  ModName: test.exe
ModVer: 0.0.0.0  Offset: 000039ac