HRESULT CTypeInfoBrowse::CrackProperty(IUnknown* pUnknown, CPropInfoArray& arrProp, enumPropType enumType)
{
	if (pUnknown == NULL)
		return E_INVALIDARG; 

	CComQIPtr<IPerPropertyBrowsing> ppb(pUnknown);

	CComQIPtr<IDispatch> spDisp = pUnknown;
	UINT nInfoCount = 0;
	HRESULT hr = spDisp->GetTypeInfoCount(&nInfoCount);
	if (FAILED(hr))
		return hr;

	CComPtr<ITypeInfo> pti;	
	for (UINT i = 0; i < nInfoCount; i++)
	{
		hr = spDisp->GetTypeInfo(i, LOCALE_SYSTEM_DEFAULT, &pti);	
		if (FAILED(hr)) 
			return hr;
		if (pti == NULL) 
			return E_UNEXPECTED;

		CrackProperty(pUnknown, pti, ppb, arrProp, enumType);

		pti.Release();
	}

	return S_OK;
}
enumPropType CTypeInfoBrowse::CrackPropertyType(IUnknown* pUnknown, BSTR bstrPropName, LPARAM lParam)
{
	enumPropType type = PROPTYPE_UNKNOWN;

	if (pUnknown == NULL)
		return type; 

	CComQIPtr<IPerPropertyBrowsing> ppb(pUnknown);

	CComQIPtr<IDispatch> spDisp = pUnknown;
	UINT nInfoCount = 0;
	HRESULT hr = spDisp->GetTypeInfoCount(&nInfoCount);
	if (FAILED(hr))
		return type;
	
	CComPtr<ITypeInfo> pti;	
	for (UINT i = 0; i < nInfoCount; i++)
	{
		hr = spDisp->GetTypeInfo(i, LOCALE_SYSTEM_DEFAULT, &pti);	
		if (FAILED(hr)) 
			return type;
		if (pti == NULL) 
			return type;

		type = CrackPropertyType(pUnknown, pti, ppb, bstrPropName, lParam);
		if (type != PROPTYPE_UNKNOWN)
			break;

		pti.Release();
	}

	return type;
}
Beispiel #3
0
result simplifier::simplify(expr const & e, bool is_root) {
    check_system("simplifier");
    m_num_steps++;
    lean_trace_inc_depth("simplifier");
    lean_trace_d("simplifier", tout() << m_rel << ": " << ppb(e) << "\n";);
Beispiel #4
0
io_state_stream const & operator<<(io_state_stream const & out, gexpr const & ge) {
    out << ppb(ge.m_expr);
    if (ge.is_universe_polymorphic()) out << " (poly)";
    return out;
}