沉默的羔羊1024 2021-05-28 09:52 采纳率: 100%
浏览 48
已采纳

vc6.0用MFC运行程序出现错误提示

error C2039: 'SetDCPenColor' : is not a member of 'CPaintDC'

e:\vc6\vc6\vc620200511\vc6\vc98\include\afxwin.h(1012) : see declaration of 'CPaintDC'

这是错误提示的代码

dc.SetDCPenColor(0xF0F0F0);

afxwin.h中的代码是这样的

class CPaintDC : public CDC
{
    DECLARE_DYNAMIC(CPaintDC)

// Constructors
public:
    CPaintDC(CWnd* pWnd);   // BeginPaint

// Attributes
protected:
    HWND m_hWnd;
public:
    PAINTSTRUCT m_ps;       // actual paint struct!

// Implementation
public:
    virtual ~CPaintDC();
#ifdef _DEBUG
    virtual void AssertValid() const;
    virtual void Dump(CDumpContext& dc) const;
#endif
};

  • 写回答

2条回答 默认 最新

  • CSDN专家-link 2021-05-28 09:55
    关注

    速查:Windows NT:5.0及以上版本;Windows:不支持;Windows CE:不支持;头文件:wingdi.h;库文件:gdi32.lib。

    windows不支持这个函数,NT下才支持

    还是CPen pen(PS_SOLID,1,0xF0F0F0);

    dc.SelectObject(&pen);吧

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器