BEGIN_COM_MAP(CTest)
 //...
 COM_INTERFACE_ENTRY(IConnectionPointContainer)
 COM_INTERFACE_ENTRY_IMPL(IConnectionPointContainer)
 //...
END_COM_MAP()Make sure this two exists.

解决方案 »

  1.   

    你从IConnectionPointContainerImpl派生,应该有IConnectionPointContainer接口,而IConnectionPoint接口不一定Query的出来的,需要调用IConnectionPointContainerImpl的FindConnectionPoint
      

  2.   

    IConnectionPointContainer *pCPC;
    IConnectionPoint *pCP;
    ......
    hr=pCPC->FindConnectionPoint(IID_IEventEvents,&pCP);
    ......Success
    hr=pCP->Advise(pClientUnknown,&dwCookie);
    ......Failed! 
    ......Error Code : 0x80040202
    Why?
      

  3.   

    你的pClientUnknown实现了IID_IEventEvents对于的接口了吗
      

  4.   

    .h
    const GUID IID_IMySink=
    {0x7B4AFBC8,0x8EC7,0x49F8,{0x90,0x84,0x91,0xE8,0xE7,0xD0,0xDC,0x26}};BEGIN_INTERFACE_PART(CMySink,IMySink)
    STDMETHOD(OnMy1Event)(VARIANT *);
    STDMETHOD(ToMy2Event)(long);
    END_INTERFACE_PART(CMySink).cpp
    ...
    hr=m_xCMySink.QueryInterface(IID_IMySink,(void **)&MySink);hr=0x80004002
    No Interface,Why?
      

  5.   

    CComPtr::Advise(...)
    返回0xc0000005
    什么意思?
    找不到这错误号
      

  6.   

    FindConnectionPoint(...)
    成功
    但是
    IConnectionPoint::Advise(...)
    失败,错误代码:0x800401fd  Not Connected
      

  7.   

    还有这要求啊?
    客户机和服务器线程模式必须一致吗?
    我的服务器时单用的ATM
    客户机没限定单用,也是ATM请高手援手解决另一个问题
      

  8.   

    请你查一查m_xCMySink.的AddRef和QueryInterface的实现,可能这有问题.