//---------------------------------------------------------------------------

#ifndef Form_MainH
#define Form_MainH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <Buttons.hpp>
#include <ExtCtrls.hpp>
#include "IdBaseComponent.hpp"
#include "IdComponent.hpp"
#include "IdContext.hpp"
#include "IdCustomTCPServer.hpp"
#include "IdTCPServer.hpp"
//---------------------------------------------------------------------------
class TWin_Main : public TForm
{
__published:	// IDE-managed Components
	TLabeledEdit *Edit_Number;
	TSpeedButton *Btn_Connect;
	TSpeedButton *Btn_Packet;
	TTimer *Timer_Test;
	TSpeedButton *Btn_Disconnect;
	void __fastcall Btn_ConnectClick(TObject *Sender);
	void __fastcall FormCreate(TObject *Sender);
	void __fastcall Btn_PacketClick(TObject *Sender);
	void __fastcall Btn_DisconnectClick(TObject *Sender);
	void __fastcall Timer_TestTimer(TObject *Sender);
private:	// User declarations
public:		// User declarations
	__fastcall TWin_Main(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TWin_Main *Win_Main;

//---------------------------------------------------------------------------
class TConsole
{
public:
	TConsole()
	{
		AllocConsole();
		freopen("CONIN$", "rb", stdin);
		freopen("CONOUT$", "wb", stdout);
		freopen("CONOUT$", "wb", stderr);
		setbuf(stderr, 0);
	}
	~TConsole()
	{
		fclose(stdin);
		fclose(stdout);
		fclose(stderr);

		FreeConsole();
	}
};

//---------------------------------------------------------------------------
static  TConsole clConsole;

//---------------------------------------------------------------------------
#endif
