// ServerControl.h : CServerControl の宣言

#pragma once
#include "resource.h"       // メイン シンボル

#include "04WebServer.h"


// CServerControl
class ATL_NO_VTABLE CServerControl : 
	public CComObjectRootEx<CComSingleThreadModel>,
	public CComCoClass<CServerControl, &CLSID_ServerControl>,
	public IDispatchImpl<IServerControl, &IID_IServerControl, &LIBID_My04WebServerLib, /*wMajor =*/ 1, /*wMinor =*/ 0>
{
public:
	CServerControl()
	{
	}

DECLARE_REGISTRY_RESOURCEID(IDR_SERVERCONTROL)


BEGIN_COM_MAP(CServerControl)
	COM_INTERFACE_ENTRY(IServerControl)
	COM_INTERFACE_ENTRY(IDispatch)
END_COM_MAP()


	DECLARE_PROTECT_FINAL_CONSTRUCT()

	HRESULT FinalConstruct()
	{
		return S_OK;
	}
	
	void FinalRelease() 
	{
	}

public:

	STDMETHOD(StartServer)(SHORT* status);
	STDMETHOD(StopServer)(void);
	STDMETHOD(GetServerErrorString)(BSTR* str);
	STDMETHOD(IsRunning)(SHORT* ret);
	STDMETHOD(IsService)(SHORT* ret);
	STDMETHOD(GetServerInfo)(BSTR* ret);
	STDMETHOD(GetServerSetting)(BSTR* ret);
	STDMETHOD(GetServerContext)(BSTR* ret);
	STDMETHOD(GetServerRoot)(BSTR* retpath);
	STDMETHOD(IsActive)(SHORT* ret);
};

OBJECT_ENTRY_AUTO(__uuidof(ServerControl), CServerControl)
