#ifndef _WSOCXCONTROL_H_

#include "IPServer.H"
#include "CtrlObj.H"
//#include "olectl.h"
#include "IWSocx.h"
//#include "Dispids.H"

class WSDocxControl :public COleControl,public IWSocx,public ISupportErrorInfo{
  public:
    DECLARE_STANDARD_UNKNOWN();
    DECLARE_STANDARD_DISPATCH();
    DECLARE_STANDARD_SUPPORTERRORINFO();

    WSDocxControl(IUnknown *pUnkOuter);
    virtual ~WSDocxControl();

    static IUnknown *Create(IUnknown *);
    virtual BOOL    AfterCreateWindow(void);
    virtual void    BeforeDestroyWindow(void);
    virtual void    AfterDestroyWindow(void);

  private:

    STDMETHOD(LoadBinaryState)(IStream *pStream);
    STDMETHOD(SaveBinaryState)(IStream *pStream);
    STDMETHOD(LoadTextState)(IPropertyBag *pPropertyBag, IErrorLog *pErrorLog);
    STDMETHOD(SaveTextState)(IPropertyBag *pPropertyBag, BOOL fWriteDefault);
    STDMETHOD(OnDraw)(DWORD dvaspect, HDC hdcDraw, LPCRECTL prcBounds, LPCRECTL prcWBounds, HDC hicTargetDev, BOOL fOptimize);


    virtual LRESULT WindowProc( UINT msg, WPARAM wParam, LPARAM lParam);
    virtual BOOL    RegisterClassData(void);

    virtual HRESULT InternalQueryInterface(REFIID, void **);
};

extern const GUID    *rgWSocxPropPages [];
DEFINE_WINDOWLESSCONTROLOBJECT(WSocx,
    &CLSID_WSocx,
    "ActiveXWSocxControl",
    WSDocxControl::Create,
    1,
    &IID_IWSocx,
    "WSOCX.HLP",
    &DIID_DWSocxEvents,
    OLEMISC_SETCLIENTSITEFIRST|OLEMISC_ACTIVATEWHENVISIBLE|
OLEMISC_RECOMPOSEONRESIZE|OLEMISC_CANTLINKINSIDE|OLEMISC_INSIDEOUT,
	FALSE,
	FALSE,
    RESID_TOOLBOX_BITMAP,
    "WSOCXWndClass",
    1,
    rgWSocxPropPages,
    0,
    NULL);

#define OBJECT_TYPE_CTLWSOCX 0
#define OBJECT_TYPE_PPGWSOCXGENERAL 1

#define _WSOCXCONTROL_H_
#endif // _WSOCXCONTROL_H_


