Dave Murray wrote: > Hi, > > Does anyone know of a tutorial or any other info on using the MS > WinHTTP API through COM? The only site I can find is this one: > > http://www.saunalahti.fi/janij/publications/delphi_developer.html > > And that just tells you the guy wrote an article about it for a US > magazine that is no longer published. :( > > I'm trying to download a jpeg as a stream and I'm having problems > with the IWinHttpRequest.responseStream method. MSDN says it should > return an IStream but the Delphi interface unit says it returns an > OleVariant. > > I really don't want to have to use ICS or Indy. I'm trying to do this > without requiring an entire component library for one small function. > > Thanks, > Dave. > > Dave Murray > Glasgow, UK
http://msdn2.microsoft.com/en-us/library/aa384023.aspx Says it returns a VARIANT. A VARIANT can contain a pointer to an IUnknown interface. Think of IUnknown as the ultimate base class in COM. From an IUnknown, you can "cast" (QueryInterface()) it to the type you want: IStream. -- Thomas Hruska CubicleSoft President Ph: 517-803-4197 *NEW* MyTaskFocus 1.1 Get on task. Stay on task. http://www.CubicleSoft.com/MyTaskFocus/

