1

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

我知道如果源接口(EventInterface)的 COnnectionPoint 有错误,它会FindConnectionPoint返回。NULL

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

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

//
// 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 
4

0 回答 0