내부에 com 맵이있는 관리되지 않는 C++ 클래스가 있습니다. EX :해결되지 않은 외부 기호 ... QueryInterface
BEGIN_COM_MAP
(MyClass)
COM_INTERFACE_ENTRY(...)
END_COM_MAP
하지만 지금은 클래스 내에서 나는 다음과 같은 오류 얻을 this-> QueryInterface를 호출하려고하는 경우 : 나는 시도하고 QueryInterface 메서드를 구현하는 경우, 지금
unresolved external symbol "public: virtual long __stdcall CTest::QueryInterface(struct _GUID const &,void * *)" ([email protected]@@[email protected]@[email protected]) referenced in function "public: __thiscall CTest::CTest(void)" ([email protected]@[email protected])
하지만를 I 다음 오류가 발생합니다.
error C2535: 'HRESULT CTest::QueryInterface(const IID &,void **) throw()' : member function already defined or declared
내가 뭘 잘못하고 있니?
* QueryInterface를 호출 할 수 있는지 여부에 관계없이 가상 함수이므로 생성자의 가상 메서드 호출에 대한 표준 조언 *이 적용됩니다. –
QueryInterface (일명 QI)는 일반적으로 생성자에서 호출되지 않습니다. 객체는 기본 클래스 out에서 생성되며 COM 지원이 기본 클래스를 둘러싼 래퍼로 추가되면 QI는 상속 체인을 따라 생성자에서 작동하지 않습니다. 이 물건은 대개 FinalConstruct 나 Initialize 메소드에서 처리됩니다. –
답변을 주셔서 감사합니다. 이들은 위대한 explions했다. – Kyle