关于error C2065: 'IID__IPolyCtlEvents' : undeclared identifier

今年夏天,我在写MSDN上的ATL示例project Polygon时,添加事件后出现了一下六个错误:

       error C2065: 'IID__IPolyCtlEvents' : undeclared identifier

       error C2440: 'static_cast' : cannot convert from 'class CPolyCtl *' to 'class ATL::_ICPLocator *' 

              Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast

      fatal error C1903: unable to recover from previous error(s); stopping compilation

       error C2065: 'IID__IPolyCtlEvents' : undeclared identifier

       error C2440: 'static_cast' : cannot convert from 'class CPolyCtl *' to 'class ATL::_ICPLocator *' 

              Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast

       fatal error C1903: unable to recover from previous error(s); stopping compilation
    Generating Code...

当时也不知道怎么解决,明明是根据原文仔细认真编写的,怎么会出错误呢?浪费了很多时间,在网上也没找的解救办法。后来,经过本人不懈的努力,终于把问题解决了,特写此稿,与同志们分享。

   当我们 Go to definition of IID__IPolyCtlEvents,在Polygon_i.c文件中我们可以看到这样的这样的定义:

           const IID DIID__INextCtlEvents = 0x79A66825,0x81D1,0x4233,0x83,0xF3,0x8E,0xA4,0xF8,0xBB,0x2B,0x4C}}; 

 当我们把CONNECTION_POINT_ENTRY(IID__INextCtlEvents)改为CONNECTION_POINT_ENTRY(DIID__INextCtlEvents)后,

问题就这么解决了!呵呵。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值