FindConnectionPoint方法返回null连接点

时间:2013-07-02 06:55:14

标签: c# c++ com event-handling iconnectionpoint

我发现这个POST在使用IConnectionPoints接口进行COM Interop事件处理时几乎类似于我的代码。
如果您有任何与此主题相关的信息,请建议我。

我知道如果COnnectionPoint中有源接口(EventInterface)出错,FindConnectionPoint会返回NULL

我通过QueryInterface方法检查了支持源接口的COM对象(P.S :: HRESULT返回S_OK)。

这里发生了什么类型的错误?
请参考帖子。我也有同样的问题。 的更新: 我的文件快照>>

//
// Named GUID constants initializations
//

extern "C" const GUID __declspec(selectany) LIBID_CSharp =
    {0x4e5098b7,0x4e51,0x45e5,{0xa7,0x05,0xa7,0xe3,0xc5,0x1e,0x2a,0x80}};
extern "C" const GUID __declspec(selectany) CLSID_PropertyChangeEventArgs =
    {0xe3a5b5e1,0xda28,0x32cf,{0x93,0x9c,0x18,0x6e,0x90,0xe8,0xd1,0x08}};
extern "C" const GUID __declspec(selectany) IID_ISomeInterface =
    {0x5f4c254f,0xa363,0x4afd,{0xad,0x5d,0x6d,0x52,0x83,0xfa,0x5e,0x59}};
extern "C" const GUID __declspec(selectany) CLSID_Class1 =
    {0xf08e4034,0x6904,0x49c4,{0xa2,0x89,0x52,0xf2,0x72,0xc9,0xe6,0x58}};
extern "C" const GUID __declspec(selectany) IID__DownloadEventArgs =
    {0x6df89fd5,0xa7be,0x3699,{0x98,0x57,0xa3,0xe2,0xec,0x69,0xd2,0x60}};
extern "C" const GUID __declspec(selectany) IID_ISomeEventsInterface =
    {0x1e430900,0xd303,0x490a,{0xa4,0x73,0xca,0x91,0x46,0xc6,0x7e,0x75}};

} // namespace CSharp

我的cpp文件快照>>

IUnknown* pIUnknown ;
HRESULT hresult = CoInitialize(NULL);
IConnectionPointContainer* pIConnectionPointContainerTemp;
IConnectionPoint* pIConnectionPoint; 
DWORD* cookie=0;
CSharp::ISomeInterfacePtr pIsomeInterface(__uuidof(CSharp::Class1));
hresult=CoCreateInstance(__uuidof(CSharp::Class1), NULL, CLSCTX_INPROC_SERVER, IID_IUnknown, (void**)&pIUnknown);
hresult=pIsomeInterface->QueryInterface(IID_IConnectionPointContainer, (void**)&pIConnectionPointContainerTemp);
pIConnectionPointContainerTemp->FindConnectionPoint(CSharp::IID_ISomeEventsInterface ,&pIConnectionPoint);//Added QUICK watch here>>raised error here CXX0017: Error: symbol "ManagedDLL::IID_ISomeEventsInterface " not found 

0 个答案:

没有答案