public HResult EndCreateObject(IMFAsyncResult pResult, out MFObjectType pObjectType, out object ppObject) { pObjectType = MFObjectType.ByteStream; HResult hr = pResult.GetObject(out ppObject); if (MFError.Succeeded(hr)) { IcyScheme icy = (IcyScheme)ppObject; // Wait for the HttpWebRequest to finish connecting. This // includes sending the request, and processing the response // headers and caching some data (see m_FirstBlock). hr = icy.WaitForConnect(); } return(hr); }
public HResult BeginCreateObject(string pwszURL, MFResolution dwFlags, IPropertyStore pProps, out object ppIUnknownCancelCookie, IMFAsyncCallback pCallback, object pUnkState) { // The constructor launches an async connect to the url. IcyScheme ice = new IcyScheme(pwszURL); IMFAsyncResult pResult; MFError hrthrowonerror = MFExtern.MFCreateAsyncResult( ice, pCallback, pUnkState, out pResult); ppIUnknownCancelCookie = ice; hrthrowonerror = MFExtern.MFInvokeCallback(pResult); return(HResult.S_OK); }