home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / com / activexcontrol / basectl / include / internet.h < prev    next >
C/C++ Source or Header  |  1997-10-05  |  2KB  |  86 lines

  1. //=--------------------------------------------------------------------------=
  2. // Internet.H
  3. //=--------------------------------------------------------------------------=
  4. // Copyright 1995-1997 Microsoft Corporation.  All Rights Reserved.
  5. //
  6. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 
  7. // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 
  8. // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 
  9. // PARTICULAR PURPOSE.
  10. //=--------------------------------------------------------------------------=
  11. //
  12. // class declaration for the URLDib2 control.
  13. //
  14. #ifndef _INTERNET_H
  15. #define _INTERNET_H
  16.  
  17. #define DISPID_PROGRESS 1958
  18.  
  19. #ifndef __MKTYPLIB__
  20.  
  21. #include "urlmon.H"
  22. #include "ocidl.h"
  23. #include "docobj.h"   // for IServiceProvider
  24.  
  25. #include "IPServer.H"
  26. #include "CtrlObj.H"
  27.  
  28.  
  29.  
  30. class CInternetControl : public COleControl
  31. {
  32. public:
  33.     CInternetControl(IUnknown *     pUnkOuter, 
  34.                     int                     iPrimaryDispatch, 
  35.                     void *          pMainInterface);
  36.  
  37.     virtual ~CInternetControl();
  38.  
  39.     // IUnknown methods
  40.     //
  41.     DECLARE_STANDARD_UNKNOWN();
  42.  
  43.     // Call this method to start the download of a URL. 'propId' will 
  44.     //      be passed back to you OnData below.
  45.     HRESULT SetupDownload( LPOLESTR url, DISPID propId);
  46.  
  47.  
  48.     //      Derived classes implement this method. It will be called when
  49.     //      data has arrived for a given dispid.
  50.     virtual HRESULT OnData( DISPID id, DWORD grfBSCF,
  51.                     IStream * bitstrm, DWORD amount );
  52.  
  53.  
  54.     //      Derived classes can implement this method. It will be
  55.     //      called at various times during the download.
  56.     virtual HRESULT OnProgress( DISPID id, ULONG ulProgress,
  57.                     ULONG ulProgressMax,
  58.                     ULONG ulStatusCode,
  59.                     LPCWSTR pwzStatusText);
  60.  
  61.     //      Call this method to turn a URL into a Moniker.
  62.     HRESULT GetAMoniker( LPOLESTR   url, IMoniker ** );
  63.  
  64.  
  65.     HRESULT FireReadyStateChange( long newState );
  66.     HRESULT FireProgress( ULONG dwAmount );
  67.  
  68.  
  69.     // Override base class implementation...
  70.  
  71.     virtual HRESULT InternalQueryInterface(REFIID, void **);
  72.  
  73. protected:
  74.     HRESULT GetBindHost();
  75.  
  76.     IBindHost *             m_host;
  77.     long                    m_readyState;
  78.  
  79.     // BUGBUG: We should track all the downloads
  80.  
  81. };
  82.  
  83. #endif __MKTYPLIB__
  84.  
  85. #endif _INTERNET_H
  86.