示例#1
0
CSaxHandlers& CSaxHandlers::operator=(const CSaxHandlers& handlers)
{
	if (this != &handlers)
	{
		if (handlers.m_lpDispatch == NULL)
			ReleaseDispatch();
		else
		{
			handlers.m_lpDispatch->AddRef();
			AttachDispatch(handlers.m_lpDispatch);
		}
	}

	return *this;
}
示例#2
0
CSaxModule& CSaxModule::operator=(const CSaxModule& module)
{
	if (this != &module)
	{
		if (module.m_lpDispatch == NULL)
			ReleaseDispatch();
		else
		{
			module.m_lpDispatch->AddRef();
			AttachDispatch(module.m_lpDispatch);
		}
	}

	return *this;
}
示例#3
0
HRESULT CTRiASNotificationSinkDisp::FInit (IDispatch *pIDisp)
{
	if (NULL == pIDisp) return E_POINTER;

	pIDisp -> AddRef();
	AttachDispatch(pIDisp);

	for (int i = 0; i < _countof(s_pcoleNames); i++) {
	HRESULT hr = pIDisp -> GetIDsOfNames (IID_NULL, (LPOLESTR *)&s_pcoleNames[i], 1, m_lcid, &m_dwDispId[i]);
		
		if (FAILED(hr)) {
			if (hr != DISP_E_UNKNOWNNAME)
				return hr;

		// solange dual interfaces nicht unterstützt werden hier nach
		// den alternativen Namen von VB5 fragen
			hr = pIDisp -> GetIDsOfNames (IID_NULL, (LPOLESTR *)&s_pcoleAltNames[i], 1, m_lcid, &m_dwDispId[i]);
			if (FAILED(hr) && hr != DISP_E_UNKNOWNNAME)
				return hr;
		}
	}

return S_OK;
}