MCPcopy Create free account
hub / github.com/mhammond/pywin32 / TestQueryInterface

Method TestQueryInterface

com/TestSources/PyCOMTest/PyCOMImpl.cpp:817–846  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

815}
816
817HRESULT CPyCOMTest::TestQueryInterface()
818{
819 IUnknown* pObj = 0;
820 IPyCOMTest * pCOMTest = 0;
821 HRESULT hr = S_OK;
822
823 MULTI_QI mqi[1] = {
824 &IID_IUnknown, NULL, E_FAIL
825 };
826
827 COSERVERINFO server = {
828 (DWORD)0, 0, (COAUTHINFO*)NULL, (DWORD)0
829 };
830
831 // Create an instance of the test server
832 hr = CoCreateInstanceEx(CLSID_PythonTestPyCOMTest, NULL, CLSCTX_LOCAL_SERVER, &server, 1, mqi);
833 if (FAILED(hr)) { goto exit; }
834 pObj = mqi[0].pItf;
835
836 // Query for the custom interface
837 hr = pObj->QueryInterface(IID_IPyCOMTest, (LPVOID*)&pCOMTest);
838 if (FAILED(hr)) { goto exit; }
839
840 hr = S_OK;
841
842exit:
843 if (pObj) { pObj->Release(); pObj = 0; }
844 if (pCOMTest) { pCOMTest->Release(); pCOMTest = 0; }
845 return hr;
846}
847
848
849HRESULT CPyCOMTest::DoubleCurrencyByVal(CY *v)

Callers 1

TestQueryInterfaceFunction · 0.80

Calls 3

FAILEDFunction · 0.85
QueryInterfaceMethod · 0.45
ReleaseMethod · 0.45

Tested by

no test coverage detected