インターフェイスを使用して COM 相互運用イベント処理を行っているときに、私のコードにほぼ似ているこのPOSTを見つけました。
このトピックに関連する情報があれば教えてください。IConnectionPoints
ソースインターフェース(EventInterface)とのCONnectionPointにエラーがあればFindConnectionPoint
復帰することがわかっています。NULL
ソース インターフェイスをサポートする COM オブジェクトを QueryInterface メソッド (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