Index: trunk/AboutmemMapDialog.cpp
===================================================================
--- trunk/AboutmemMapDialog.cpp	(revision 10)
+++ trunk/AboutmemMapDialog.cpp	(revision 10)
@@ -0,0 +1,38 @@
+// AboutmemMapDialog.cpp : fichier d'implémentation
+//
+
+#include "stdafx.h"
+#include "Modbucfg.h"
+#include "AboutmemMapDialog.h"
+#include ".\aboutmemmapdialog.h"
+
+
+// Boîte de dialogue CAboutmemMapDialog
+
+IMPLEMENT_DYNAMIC(CAboutmemMapDialog, CDialog)
+CAboutmemMapDialog::CAboutmemMapDialog(CWnd* pParent /*=NULL*/)
+	: CDialog(CAboutmemMapDialog::IDD, pParent)
+{
+}
+
+CAboutmemMapDialog::~CAboutmemMapDialog()
+{
+}
+
+void CAboutmemMapDialog::DoDataExchange(CDataExchange* pDX)
+{
+	CDialog::DoDataExchange(pDX);
+}
+
+
+BEGIN_MESSAGE_MAP(CAboutmemMapDialog, CDialog)
+	ON_COMMAND(ID_APP_MEM_MAP, OnAppMemMap)
+END_MESSAGE_MAP()
+
+
+// Gestionnaires de messages CAboutmemMapDialog
+
+void CAboutmemMapDialog::OnAppMemMap()
+{
+	// TODO : ajoutez ici le code de votre gestionnaire de commande
+}
Index: trunk/AboutmemMapDialog.h
===================================================================
--- trunk/AboutmemMapDialog.h	(revision 10)
+++ trunk/AboutmemMapDialog.h	(revision 10)
@@ -0,0 +1,23 @@
+#pragma once
+
+
+// Boîte de dialogue CAboutmemMapDialog
+
+class CAboutmemMapDialog : public CDialog
+{
+	DECLARE_DYNAMIC(CAboutmemMapDialog)
+
+public:
+	CAboutmemMapDialog(CWnd* pParent = NULL);   // constructeur standard
+	virtual ~CAboutmemMapDialog();
+
+// Données de boîte de dialogue
+	enum { IDD = ID_APP_MEM_MAP };
+
+protected:
+	virtual void DoDataExchange(CDataExchange* pDX);    // Prise en charge DDX/DDV
+
+	DECLARE_MESSAGE_MAP()
+public:
+	afx_msg void OnAppMemMap();
+};
Index: trunk/ChildFrm.cpp
===================================================================
--- trunk/ChildFrm.cpp	(revision 10)
+++ trunk/ChildFrm.cpp	(revision 10)
@@ -0,0 +1,65 @@
+// ChildFrm.cpp : implementation of the CChildFrame class
+//
+
+#include "stdafx.h"
+#include "Modbucfg.h"
+
+#include "ChildFrm.h"
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+/////////////////////////////////////////////////////////////////////////////
+// CChildFrame
+
+IMPLEMENT_DYNCREATE(CChildFrame, CMDIChildWnd)
+
+BEGIN_MESSAGE_MAP(CChildFrame, CMDIChildWnd)
+	//{{AFX_MSG_MAP(CChildFrame)
+		// NOTE - the ClassWizard will add and remove mapping macros here.
+		//    DO NOT EDIT what you see in these blocks of generated code !
+	//}}AFX_MSG_MAP
+END_MESSAGE_MAP()
+
+/////////////////////////////////////////////////////////////////////////////
+// CChildFrame construction/destruction
+
+CChildFrame::CChildFrame()
+{
+	// TODO: add member initialization code here
+	
+}
+
+CChildFrame::~CChildFrame()
+{
+}
+
+BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)
+{
+	// TODO: Modify the Window class or styles here by modifying
+	//  the CREATESTRUCT cs
+
+	return CMDIChildWnd::PreCreateWindow(cs);
+}
+
+/////////////////////////////////////////////////////////////////////////////
+// CChildFrame diagnostics
+
+#ifdef _DEBUG
+void CChildFrame::AssertValid() const
+{
+	CMDIChildWnd::AssertValid();
+}
+
+void CChildFrame::Dump(CDumpContext& dc) const
+{
+	CMDIChildWnd::Dump(dc);
+}
+
+#endif //_DEBUG
+
+/////////////////////////////////////////////////////////////////////////////
+// CChildFrame message handlers
Index: trunk/ChildFrm.h
===================================================================
--- trunk/ChildFrm.h	(revision 10)
+++ trunk/ChildFrm.h	(revision 10)
@@ -0,0 +1,52 @@
+// ChildFrm.h : interface of the CChildFrame class
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#if !defined(AFX_CHILDFRM_H__A3BAD4B1_F5AE_11D1_8FE9_6CD504C1BC01__INCLUDED_)
+#define AFX_CHILDFRM_H__A3BAD4B1_F5AE_11D1_8FE9_6CD504C1BC01__INCLUDED_
+
+#if _MSC_VER >= 1000
+#pragma once
+#endif // _MSC_VER >= 1000
+
+class CChildFrame : public CMDIChildWnd
+{
+	DECLARE_DYNCREATE(CChildFrame)
+public:
+	CChildFrame();
+
+// Attributes
+public:
+
+// Operations
+public:
+
+// Overrides
+	// ClassWizard generated virtual function overrides
+	//{{AFX_VIRTUAL(CChildFrame)
+	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
+	//}}AFX_VIRTUAL
+
+// Implementation
+public:
+	virtual ~CChildFrame();
+#ifdef _DEBUG
+	virtual void AssertValid() const;
+	virtual void Dump(CDumpContext& dc) const;
+#endif
+
+// Generated message map functions
+protected:
+	//{{AFX_MSG(CChildFrame)
+		// NOTE - the ClassWizard will add and remove member functions here.
+		//    DO NOT EDIT what you see in these blocks of generated code!
+	//}}AFX_MSG
+	DECLARE_MESSAGE_MAP()
+};
+
+/////////////////////////////////////////////////////////////////////////////
+
+//{{AFX_INSERT_LOCATION}}
+// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
+
+#endif // !defined(AFX_CHILDFRM_H__A3BAD4B1_F5AE_11D1_8FE9_6CD504C1BC01__INCLUDED_)
Index: trunk/CommParameters.cpp
===================================================================
--- trunk/CommParameters.cpp	(revision 10)
+++ trunk/CommParameters.cpp	(revision 10)
@@ -0,0 +1,653 @@
+// CommParameters.cpp : implementation file
+//
+
+#include "stdafx.h"
+#include "Modbucfg.h"
+#include "CommParameters.h"
+#include "OleFuncs.h"
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+/////////////////////////////////////////////////////////////////////////////
+// CCommParameters dialog
+
+
+CCommParameters::CCommParameters(CWnd* pParent /*=NULL*/)
+	: CDialog(CCommParameters::IDD, pParent)
+{
+	//{{AFX_DATA_INIT(CCommParameters)
+	m_bDTRDSR = FALSE;
+	m_bRTSCTS = FALSE;
+	m_bXONXOFF = FALSE;
+	//}}AFX_DATA_INIT
+
+	m_pConnection=NULL;
+	m_bModeNew=FALSE;
+
+}
+
+
+void CCommParameters::DoDataExchange(CDataExchange* pDX)
+{
+	CDialog::DoDataExchange(pDX);
+	//{{AFX_DATA_MAP(CCommParameters)
+	DDX_Control(pDX, IDC_EDIT_DELAY, m_edtDelay);
+	DDX_Control(pDX, IDC_CHK_TCP_SERVER, m_chkTcpServer);
+	DDX_Control(pDX, IDC_EDIT_DCOM_SERVER, m_edtDcomServer);
+	DDX_Control(pDX, IDC_EDIT_PORT, m_edtServerPort);
+	DDX_Control(pDX, IDC_EDIT_IP_ADDR, m_edtServerIP);
+	DDX_Control(pDX, IDC_CHK_ACTIVE, m_chkActive);
+	DDX_Control(pDX, IDC_EDIT_CHAR_INTERVAL, m_edtCharInterval);
+	DDX_Control(pDX, IDC_EDIT_TIME_OUT, m_edtTimeOut);
+	DDX_Control(pDX, IDC_CBO_BYTESIZE, m_cboByteSize);
+	DDX_Control(pDX, IDC_CBO_STOPBITSCB, m_cboStopBits);
+	DDX_Control(pDX, IDC_CBO_PARITY, m_cboParity);
+	DDX_Control(pDX, IDC_CBO_COM_PORT, m_cboPorta);
+	DDX_Control(pDX, IDC_CBO_BAUD_RATE, m_cboBaudRate);
+	DDX_Check(pDX, IDC_CHK_DTRDSR, m_bDTRDSR);
+	DDX_Check(pDX, IDC_CHK_RTSCTS, m_bRTSCTS);
+	DDX_Check(pDX, IDC_CHK_XONXOFF, m_bXONXOFF);
+	//}}AFX_DATA_MAP
+}
+
+
+BEGIN_MESSAGE_MAP(CCommParameters, CDialog)
+	//{{AFX_MSG_MAP(CCommParameters)
+	ON_BN_CLICKED(IDC_OK, OnOkey)
+	ON_BN_CLICKED(IDC_BUTT_FIND_IP, OnButtFindIP)
+	//}}AFX_MSG_MAP
+END_MESSAGE_MAP()
+
+/////////////////////////////////////////////////////////////////////////////
+// CCommParameters message handlers
+
+void CCommParameters::LoadCombos()
+{
+
+	int nIndex=-1;
+    CString str;
+	
+	//port 
+	m_cboPorta.AddString("COM1"); 
+	m_cboPorta.AddString("COM2");
+	m_cboPorta.AddString("COM3");
+	m_cboPorta.AddString("COM4");
+	m_cboPorta.AddString("COM5"); 
+	m_cboPorta.AddString("COM6");
+	m_cboPorta.AddString("COM7");
+	m_cboPorta.AddString("COM8");
+	m_cboPorta.SetCurSel(0);
+
+	//baudrate 
+	/*CBR_110 	CBR_19200
+    CBR_300 	CBR_38400
+    CBR_600 	CBR_56000
+	CBR_1200	CBR_57600
+	CBR_2400	CBR_115200
+	CBR_4800	CBR_128000
+	CBR_9600	CBR_256000
+	CBR_14400 */
+	str.Format("%d", CBR_110);
+    nIndex=m_cboBaudRate.AddString(str);
+	m_cboBaudRate.SetItemData( nIndex,CBR_110);
+
+	str.Format("%d", CBR_300);
+    nIndex=m_cboBaudRate.AddString(str);
+    m_cboBaudRate.SetItemData( nIndex,CBR_300);
+
+	str.Format("%d", CBR_600);
+    nIndex=m_cboBaudRate.AddString(str);
+    m_cboBaudRate.SetItemData( nIndex,CBR_600);
+
+	str.Format("%d", CBR_1200);
+    nIndex=m_cboBaudRate.AddString(str);
+    m_cboBaudRate.SetItemData( nIndex,CBR_1200);
+
+	str.Format("%d", CBR_2400);
+    nIndex=m_cboBaudRate.AddString(str);
+    m_cboBaudRate.SetItemData( nIndex,CBR_2400);
+
+	str.Format("%d", CBR_4800);
+    nIndex=m_cboBaudRate.AddString(str);
+    m_cboBaudRate.SetItemData( nIndex,CBR_4800);
+
+	str.Format("%d", CBR_9600);
+    nIndex=m_cboBaudRate.AddString(str);
+    m_cboBaudRate.SetItemData( nIndex,CBR_9600);
+
+	str.Format("%d", CBR_14400);
+    nIndex=m_cboBaudRate.AddString(str);
+    m_cboBaudRate.SetItemData( nIndex,CBR_14400);
+
+	str.Format("%d", CBR_19200);
+    nIndex=m_cboBaudRate.AddString(str);
+    m_cboBaudRate.SetItemData( nIndex,CBR_19200);
+
+	str.Format("%d", CBR_38400);
+    nIndex=m_cboBaudRate.AddString(str);
+    m_cboBaudRate.SetItemData( nIndex,CBR_38400);
+
+	str.Format("%d", CBR_56000);
+    nIndex=m_cboBaudRate.AddString(str);
+    m_cboBaudRate.SetItemData( nIndex,CBR_56000);
+
+	str.Format("%d", CBR_57600);
+    nIndex=m_cboBaudRate.AddString(str);
+    m_cboBaudRate.SetItemData( nIndex,CBR_57600);
+
+	str.Format("%d", CBR_115200);
+    nIndex=m_cboBaudRate.AddString(str);
+    m_cboBaudRate.SetItemData( nIndex,CBR_115200);
+
+	str.Format("%d", CBR_128000);
+    nIndex=m_cboBaudRate.AddString(str);
+    m_cboBaudRate.SetItemData( nIndex,CBR_128000);
+
+	str.Format("%d", CBR_256000);
+    nIndex=m_cboBaudRate.AddString(str);
+    m_cboBaudRate.SetItemData( nIndex,CBR_256000);
+	m_cboBaudRate.SetCurSel(0);
+
+	//parity 
+    str="Even";
+	nIndex=m_cboParity.AddString(str);
+    m_cboParity.SetItemData( nIndex,EVENPARITY);
+
+	str="Mark";
+    nIndex=m_cboParity.AddString(str);
+    m_cboParity.SetItemData( nIndex,MARKPARITY);
+
+   	str="No parity";
+    nIndex=m_cboParity.AddString(str);
+    m_cboParity.SetItemData( nIndex,NOPARITY);
+
+	str="Odd";
+    nIndex=m_cboParity.AddString(str);
+    m_cboParity.SetItemData( nIndex,ODDPARITY);
+
+	m_cboParity.SetCurSel(0);
+
+	//stop bits 
+	str="1";
+	nIndex=m_cboStopBits.AddString(str);
+	m_cboStopBits.SetItemData( nIndex,ONESTOPBIT); 
+	str="1.5";
+	nIndex=m_cboStopBits.AddString(str);
+	m_cboStopBits.SetItemData( nIndex,ONE5STOPBITS);
+	str="2";
+	nIndex=m_cboStopBits.AddString(str);
+	m_cboStopBits.SetItemData( nIndex,TWOSTOPBITS);
+	m_cboStopBits.SetCurSel(0);
+
+	//Byte Size 
+	str="7";
+	nIndex=m_cboByteSize.AddString(str);
+	m_cboByteSize.SetItemData( nIndex,7);
+	
+	str="8";
+	nIndex=m_cboByteSize.AddString(str);
+	m_cboByteSize.SetItemData( nIndex,8); 
+	m_cboByteSize.SetCurSel(0);
+
+
+}
+
+BOOL CCommParameters::OnInitDialog() 
+{
+	CDialog::OnInitDialog();
+	
+	
+	LoadCombos();
+	
+	if (!m_bModeNew) {
+		ShowParameters();
+	}
+	
+
+	return TRUE;  // return TRUE unless you set the focus to a control
+	              // EXCEPTION: OCX Property Pages should return FALSE
+}
+
+BOOL CCommParameters::ShowParameters()
+{
+	int iIndex;
+	CString str;
+	CButton* pRadTransMode;
+	BSTR bstrTCPServer=NULL;
+	long lTcpPort=0;
+	VARIANT_BOOL bVal;
+
+	ASSERT(m_pConnection);
+
+	CAutoModbus* m_pautoModbus = m_pConnection->AutoPtr();
+
+
+	str.Format("COM%d",m_pautoModbus->ComPort());
+	iIndex=m_cboPorta.FindString(-1, str);
+	m_cboPorta.SetCurSel( iIndex );
+	//baudrate 
+	str.Format("%d",(m_pautoModbus->BaudRate()));
+    iIndex=m_cboBaudRate.FindString(-1, str);
+    m_cboBaudRate.SetCurSel( iIndex );
+
+	//parity 
+	switch (m_pautoModbus->Parity()) {
+    case EVENPARITY:
+		 str="Even"; 
+		break;
+    case MARKPARITY:
+        str="Mark";
+		break;
+    case NOPARITY:
+        str="No parity";
+		break;
+	case ODDPARITY:
+		str="Odd";
+		break;
+    default:
+		str="";
+	}
+
+	iIndex=m_cboParity.FindString(-1, str);
+    m_cboParity.SetCurSel( iIndex );
+    
+
+	//StopBits 
+	switch (m_pautoModbus->StopBits()) {
+    case ONESTOPBIT:
+		 str="1"; 
+		break;
+    case ONE5STOPBITS:
+        str="1.5";
+		break;
+    case TWOSTOPBITS:
+        str="2";
+		break;
+	default:
+		str="2";
+	}
+
+	iIndex=m_cboStopBits.FindString(-1, str);
+    m_cboStopBits.SetCurSel(iIndex);
+
+	//ByteSize
+	switch (m_pautoModbus->ByteSize()) {
+	case 7:
+		str="7";
+		break;
+	case 8:
+		str="8";
+		break;
+	default:
+		str="8";
+		break;
+	
+	}
+
+	iIndex=m_cboByteSize.FindString(-1, str);
+    m_cboByteSize.SetCurSel(iIndex);
+
+
+	//time-out 
+    str.Format("%d",m_pautoModbus->Timeout());
+    m_edtTimeOut.SetWindowText(str);
+	//char interval 
+    str.Format("%d",m_pautoModbus->SilentInterval());
+    m_edtCharInterval.SetWindowText(str);
+     
+    //Delay 
+	str.Format("%d",m_pautoModbus->Delay());
+	m_edtDelay.SetWindowText(str);
+
+
+	//active com port 
+	m_chkActive.SetCheck(m_pautoModbus->IsActive());
+
+	//flow control 
+
+    m_bDTRDSR=(mbFC_DTRDSR&m_pautoModbus->FlowControl())!=0;
+	m_bRTSCTS=(mbFC_RTSCTS&m_pautoModbus->FlowControl())!=0;
+    m_bXONXOFF=(mbFC_XONXOFF&m_pautoModbus->FlowControl())!=0;
+
+	//Transmission Mode 
+	switch (m_pautoModbus->TransmissionMode()) {
+	case mbMODE_RTU:
+		pRadTransMode=(CButton*)GetDlgItem(IDC_RAD_RTU);
+		break;
+	
+	case mbMODE_ASCII:
+	
+    default:
+		pRadTransMode=(CButton*)GetDlgItem(IDC_RAD_ASCII);
+
+	}
+	
+	 pRadTransMode->SetCheck(1);
+
+	 //Show DCOM 
+	m_edtDcomServer.SetWindowText(m_pautoModbus->Machine());
+
+	//TCP Server 
+	if (FAILED(m_pautoModbus->m_pITCPServer->get_ServerAddress(&bstrTCPServer))){
+		ASSERT(FALSE);
+	}
+	else {
+		str =bstrTCPServer;
+		::SysFreeString(bstrTCPServer);
+		m_edtServerIP.SetWindowText(str);
+	}
+	
+	VERIFY(!FAILED(m_pautoModbus->m_pITCPServer->get_ServerPort(&lTcpPort)));
+	str.Format("%d",lTcpPort);
+	m_edtServerPort.SetWindowText(str);
+
+	bVal=VARIANT_FALSE;
+	VERIFY(!FAILED(m_pautoModbus->m_pITCPServer->get_ServerActive(&bVal)));
+
+	if (VARIANT_TRUE==bVal){
+		m_chkTcpServer.SetCheck(1);
+	}
+	else {
+		m_chkTcpServer.SetCheck(0);
+	}
+
+	if (!m_bModeNew) {
+		m_edtDcomServer.EnableWindow(FALSE);
+		m_cboPorta.EnableWindow(FALSE);
+	}
+
+	UpdateData(FALSE);
+
+	return TRUE;
+}
+
+
+BOOL CCommParameters::SaveParameters()
+{
+	  int nIndex;
+	  DWORD dwBaudRate=0;
+	  BYTE byParity=0;
+	  DWORD dwTimeout;
+	  DWORD dwSilentInterval;
+	  CString str;
+	  CString sAux;
+	  CString sConnectionName;
+	  CString sMachine;
+	  BSTR bstr=NULL;
+	  BYTE byFlowControl;
+	  CButton* pRadTransMode;
+	  CAutoModbus* m_pautoModbus=NULL;	
+	  VARIANT_BOOL bValue=VARIANT_FALSE;
+	  HRESULT hr;
+
+	  CWaitCursor wait;    // display wait cursor
+
+
+	  UpdateData(TRUE);
+
+	  
+	  if (m_bModeNew) {
+		  //Create New Connection 
+		  nIndex=m_cboPorta.GetCurSel();
+		  sAux.Format("com%d",nIndex+1);
+		  m_edtDcomServer.GetWindowText(sMachine);
+		  sMachine.TrimLeft();
+		  sMachine.TrimRight();
+		  if (!sMachine.IsEmpty()) { 
+			  str=sMachine+_T(":")+sAux;
+		  }  
+		  else{ 
+			  str = sAux;
+		  }
+		  
+		  sConnectionName= str; 
+		  
+		  if (gConnections.Lookup(sConnectionName,m_pConnection)) {
+				AfxMessageBox("Connection Alredy Exist");
+				Connection(NULL);
+				return FALSE;
+		  }
+
+		  
+		  m_pConnection= gConnections.Add(sConnectionName, CConnection::AUTO);
+		  
+		  if (NULL==m_pConnection) {
+			   AfxMessageBox("Error Adding Connection");
+			   return FALSE;
+		  }
+
+		  m_pautoModbus=m_pConnection->AutoPtr();
+		
+		  hr = m_pautoModbus->CreateInstance(sMachine,sAux);
+		  
+		  if(FAILED(hr)) {
+			  
+			  if (!GetErrorMsg(hr,sAux.GetBuffer(500),500)) {
+				  sAux= _T("Can't Create Automation Object");			  
+			  }
+
+			  AfxMessageBox(sAux);
+			  goto ParamError;
+		  }
+
+	  }
+	  else {
+
+		  //edit connection 
+		  ASSERT(m_pConnection);
+		  m_pautoModbus= m_pConnection->AutoPtr();
+	  
+	  }
+	  
+	  if (0==m_chkActive.GetCheck()) {  //0==unchecked
+		  //if(!m_pautoModbus->CloseConnection()){
+		//	  AfxMessageBox("Failed to close Connection");
+		  //}
+	  }
+
+	  if (m_pautoModbus->IsActive()&&m_bModeNew) {
+			if (IDYES==AfxMessageBox( _T("This connection is already opened by other app. Show current parameters?")
+				,MB_YESNO)) {
+
+				ShowParameters();
+				goto ParamError;
+			}
+		
+	  }
+
+	  //com port 
+	  nIndex=m_cboPorta.GetCurSel();
+	 
+	  if (nIndex<0) {
+		  AfxMessageBox("Invalid com port");
+		  goto ParamError;
+	  }
+
+	  m_pautoModbus->ComPort(BYTE(nIndex+1));
+	  
+	  //Baud Rate 
+
+	  nIndex=m_cboBaudRate.GetCurSel();
+
+	  if (nIndex<0) {
+		  AfxMessageBox("Invalid Baud-Rate");
+		  goto ParamError;
+	  }
+	  dwBaudRate=m_cboBaudRate.GetItemData(nIndex);
+
+	  m_pautoModbus->BaudRate(dwBaudRate);
+	  
+	  //parity  
+	  nIndex=m_cboParity.GetCurSel();
+	  
+	  if (nIndex<0) {
+		  AfxMessageBox("Invalid Parity");
+		  goto ParamError;
+	  }	
+
+	  byParity=BYTE(m_cboParity.GetItemData(nIndex));
+
+	  m_pautoModbus->Parity(byParity);
+	  	  
+	  //Stop bits  
+	  nIndex=m_cboStopBits.GetCurSel();
+	  
+	  if (nIndex<0) {
+		  AfxMessageBox("Invalid Stop Bits");
+		  goto ParamError;
+	  }	
+	  
+	  m_pautoModbus->StopBits((BYTE)m_cboStopBits.GetItemData(nIndex));
+
+	  
+	  byFlowControl=mbFC_NONE; 
+	  if (m_bDTRDSR) {
+		  byFlowControl=byFlowControl|mbFC_DTRDSR;
+	  }
+	  
+	  if (m_bRTSCTS) {
+		  byFlowControl=byFlowControl|mbFC_RTSCTS;
+	  }
+	  
+	  if (m_bXONXOFF) {
+		  byFlowControl=byFlowControl|mbFC_XONXOFF;
+	  }
+	  m_pautoModbus->FlowControl(byFlowControl);
+
+	  //timeout 
+	  m_edtTimeOut.GetWindowText(str);
+	  dwTimeout=(DWORD)atol(str);
+	  if (0==dwTimeout) {
+		  AfxMessageBox("Invalid timeout");
+		  goto ParamError;
+	  }
+	  m_pautoModbus->Timeout(dwTimeout);
+
+	  //silentinterval 
+	  m_edtCharInterval.GetWindowText(str);
+	  dwSilentInterval=(DWORD)atol(str);
+	  if (0==dwSilentInterval) {
+		  AfxMessageBox("Invalid Char Interval");
+		  goto ParamError;
+	  }
+	  
+	  m_pautoModbus->SilentInterval(dwSilentInterval);
+
+
+	  //Delay 
+      m_edtDelay.GetWindowText(str);
+	  m_pautoModbus->Delay((DWORD)atol(str));
+
+	  //Transmission Mode 
+	  pRadTransMode=(CButton*)GetDlgItem(IDC_RAD_RTU);
+	  
+	  ASSERT(pRadTransMode);
+	  
+	  if (FALSE!=pRadTransMode->GetCheck()) {
+		  m_pautoModbus->TransmissionMode(mbMODE_RTU);
+	  }
+	  else {
+		  m_pautoModbus->TransmissionMode(mbMODE_ASCII);
+		  
+	  }
+
+
+	  //Byte Size  
+	  nIndex=m_cboByteSize.GetCurSel();
+	  
+	  if (nIndex<0) {
+		  AfxMessageBox("Invalid Byte Size");
+		  goto ParamError;
+	  }	
+	  
+	  m_pautoModbus->ByteSize((BYTE)m_cboByteSize.GetItemData(nIndex));
+	  
+	  if (! m_pautoModbus->Connect()){
+		  AfxMessageBox("Can't connect");
+		  goto ParamError;
+	  }
+	  
+
+	  //TCP Server 
+	  if (1==m_chkTcpServer.GetCheck()) {//checked
+
+		//address
+		m_edtServerIP.GetWindowText(str);
+		bstr= str.AllocSysString();
+		m_pautoModbus->m_pITCPServer->put_ServerAddress(bstr);
+		::SysFreeString(bstr);
+		//port 
+		m_edtServerPort.GetWindowText(str);
+		m_pautoModbus->m_pITCPServer->put_ServerPort(WORD(atol(str)));
+		m_pautoModbus->m_pITCPServer->StartServer(&bValue);
+		if (VARIANT_FALSE==bValue){
+			 AfxMessageBox("Error Starting Modbus TCP server");
+			 goto ParamError;
+		}
+
+	  }
+	  else {
+		m_pautoModbus->m_pITCPServer->StopServer(&bValue);
+		if (VARIANT_FALSE==bValue){
+			 AfxMessageBox("Error Stoping Modbus TCP server");
+			 goto ParamError;
+		}
+	  }
+	  return (TRUE);
+
+ParamError:
+	if (m_bModeNew) {
+		gConnections.Remove(sConnectionName); //Remove New Connection 
+		Connection(NULL);
+	}
+	 return (FALSE);
+}
+
+
+
+
+
+void CCommParameters::Connection(CConnection* pConnection)
+{
+	m_pConnection = pConnection;
+}
+
+CConnection* CCommParameters::Connection(){
+  
+	return m_pConnection;
+}
+
+
+void CCommParameters::OnOkey() 
+{
+	
+	if (SaveParameters()) {
+		CDialog::OnOK();
+	}	
+}
+
+void CCommParameters::OnCancel() 
+{
+	// TODO: Add extra cleanup here
+	Connection(NULL);
+	CDialog::OnCancel();
+}
+
+void CCommParameters::OnButtFindIP() 
+{
+
+	CWaitCursor wait;    // display wait cursor
+
+	try {
+		m_edtServerIP.SetWindowText(CBlockingSocket::GetHostIP());
+	}
+	catch(CBlockingSocketException* e) {
+		e->Delete();
+		AfxMessageBox("Failed finding local machine IP");
+	}
+	
+}
Index: trunk/CommParameters.h
===================================================================
--- trunk/CommParameters.h	(revision 10)
+++ trunk/CommParameters.h	(revision 10)
@@ -0,0 +1,76 @@
+#if !defined(AFX_COMMPARAMETERS_H__598A7320_F984_11D1_9E7B_08C003C10000__INCLUDED_)
+#define AFX_COMMPARAMETERS_H__598A7320_F984_11D1_9E7B_08C003C10000__INCLUDED_
+
+#if _MSC_VER >= 1000
+#pragma once
+#endif // _MSC_VER >= 1000
+// CommParameters.h : header file
+//
+
+#include "Globals.h"
+
+/////////////////////////////////////////////////////////////////////////////
+// CCommParameters dialog
+
+class CCommParameters : public CDialog
+{
+// Construction
+public:
+	BOOL SaveParameters();
+	void Connection(CConnection* pConnection);
+	CConnection* Connection();
+	BOOL ShowParameters();
+	void LoadCombos();
+	CCommParameters(CWnd* pParent = NULL);   // standard constructor
+
+	BOOL m_bModeNew;
+
+// Dialog Data
+	//{{AFX_DATA(CCommParameters)
+	enum { IDD = IDD_MOD_LOCAL_COM_PARAM };
+	CEdit	m_edtDelay;
+	CButton	m_chkTcpServer;
+	CEdit	m_edtDcomServer;
+	CEdit	m_edtServerPort;
+	CEdit	m_edtServerIP;
+	CButton	m_chkActive;
+	CEdit	m_edtCharInterval;
+	CEdit	m_edtTimeOut;
+	CComboBox	m_cboByteSize;
+	CComboBox	m_cboStopBits;
+	CComboBox	m_cboParity;
+	CComboBox	m_cboPorta;
+	CComboBox	m_cboBaudRate;
+	BOOL	m_bDTRDSR;
+	BOOL	m_bRTSCTS;
+	BOOL	m_bXONXOFF;
+	//}}AFX_DATA
+
+
+// Overrides
+	// ClassWizard generated virtual function overrides
+	//{{AFX_VIRTUAL(CCommParameters)
+	protected:
+	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
+	//}}AFX_VIRTUAL
+
+// Implementation
+protected:
+
+	// Generated message map functions
+	//{{AFX_MSG(CCommParameters)
+	virtual BOOL OnInitDialog();
+	afx_msg void OnOkey();
+	virtual void OnCancel();
+	afx_msg void OnButtFindIP();
+	//}}AFX_MSG
+	DECLARE_MESSAGE_MAP()
+private:
+	CConnection* m_pConnection;
+	
+};
+
+//{{AFX_INSERT_LOCATION}}
+// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
+
+#endif // !defined(AFX_COMMPARAMETERS_H__598A7320_F984_11D1_9E7B_08C003C10000__INCLUDED_)
Index: trunk/Connection.cpp
===================================================================
--- trunk/Connection.cpp	(revision 10)
+++ trunk/Connection.cpp	(revision 10)
@@ -0,0 +1,150 @@
+// Connection.cpp: implementation of the CConnection class.
+//
+//////////////////////////////////////////////////////////////////////
+
+#include "stdafx.h"
+#include "Connection.h"
+
+#ifdef _DEBUG
+#undef THIS_FILE
+static char THIS_FILE[]=__FILE__;
+#define new DEBUG_NEW
+#endif
+
+//////////////////////////////////////////////////////////////////////
+// Construction/Destruction
+//////////////////////////////////////////////////////////////////////
+
+IMPLEMENT_DYNAMIC( CConnection , CObject)
+
+
+CConnection::CConnection()
+{
+	m_pModbus=NULL;
+}
+
+CConnection::~CConnection()
+{
+
+	
+}
+
+
+CConnection::CConnection(WORD wType , LPCTSTR sKey)
+{
+	m_sKey = sKey;
+	m_wType = wType;
+	
+	switch (wType) {
+
+	case AUTO:
+		m_pModbus= new CAutoModbus();
+		break;
+	case REMOTE:
+		m_pModbus= new CRemoteModbus();
+		break;
+	default:
+		ASSERT(FALSE); //Type Error
+	}
+
+}
+
+CConnection::CConnection(const CConnection& rConnection)
+{
+	m_pModbus = rConnection.m_pModbus;
+	m_sKey = rConnection.m_sKey;
+	m_wType = rConnection.m_wType;
+
+}
+
+
+CAutoModbus* CConnection::AutoPtr()
+{
+	if (AUTO==m_wType) {
+		return (CAutoModbus*)m_pModbus;
+	}
+	else {
+		ASSERT(FALSE);//Type Error 
+		return NULL;
+	}
+}
+
+CRemoteModbus* CConnection::RemotePtr()
+{
+	if (REMOTE==m_wType) {
+		return (CRemoteModbus*)m_pModbus;
+	}
+	else {
+		ASSERT(FALSE);//Type Error 
+		return NULL;
+	}
+
+}
+
+void CConnection::Delete()
+{
+
+	if (m_pModbus!=NULL) {
+		switch (m_wType) {
+			
+		case AUTO:
+			delete AutoPtr();
+			break;
+		case REMOTE:
+			delete RemotePtr();
+			break;
+		default:
+			ASSERT(FALSE); //Type Error
+		}
+	}
+
+	delete this;
+}
+
+
+CString CConnection::DcomServer()
+{
+	return m_sDcomServer;
+}
+
+void CConnection::DcomServer(LPCTSTR szDcomServer)
+{
+	m_sDcomServer=szDcomServer;
+}
+
+CString CConnection::Key() {
+	return m_sKey;
+}
+
+WORD CConnection::Type() {
+
+	return m_wType;
+
+}
+
+
+ void CConnection::Serialize( CArchive& archive )
+  {
+	  // call base class function first
+	  // base class is CObject in this case
+	  CObject::Serialize( archive );
+	  
+
+	  // now do the stuff for our specific class
+	  if( archive.IsStoring() ){
+		 archive <<m_sDcomServer;
+      } 
+	  else {
+		 archive >>m_sDcomServer;
+      }
+	  
+	  switch(Type()) {
+	  case AUTO:
+		  AutoPtr()->Serialize(archive);
+		  break;
+	  case REMOTE:
+		  RemotePtr()->Serialize(archive);
+		  break;
+	  }
+
+  }
Index: trunk/Connection.h
===================================================================
--- trunk/Connection.h	(revision 10)
+++ trunk/Connection.h	(revision 10)
@@ -0,0 +1,54 @@
+// Connection.h: interface for the CConnection class.
+//
+//////////////////////////////////////////////////////////////////////
+
+#if !defined(AFX_CONNECTION_H__E83D7142_F7E4_11D1_8FE9_6CD504C1BC01__INCLUDED_)
+#define AFX_CONNECTION_H__E83D7142_F7E4_11D1_8FE9_6CD504C1BC01__INCLUDED_
+
+#if _MSC_VER >= 1000
+#pragma once
+#endif // _MSC_VER >= 1000
+
+#include "RemoteModbus.h"
+#include "AutoModbus.h"
+
+
+
+
+class CConnection : public CObject  
+{
+
+	DECLARE_DYNAMIC(CConnection)
+
+public:
+	void Serialize(CArchive& archive);
+	void DcomServer(LPCTSTR  szDcomServer);
+	CString DcomServer();
+	void Delete();
+	CRemoteModbus* RemotePtr();
+	CAutoModbus* AutoPtr();
+	CConnection();
+	virtual ~CConnection();
+	void Key(CString& sKey);
+	CString Key();
+	CConnection(WORD wType , LPCTSTR sKey);
+	CConnection(const CConnection& rConnection);
+	WORD Type();
+	
+
+	enum _connection_type_ {
+		NONE=0,
+		AUTO=1,
+		REMOTE=2
+	};
+
+	CModbus* m_pModbus; //local/dcom or remote/openmodbus
+
+private:
+	CString m_sKey;
+	WORD m_wType;
+	CString m_sDcomServer;
+
+};
+
+#endif // !defined(AFX_CONNECTION_H__E83D7142_F7E4_11D1_8FE9_6CD504C1BC01__INCLUDED_)
Index: trunk/Connections.cpp
===================================================================
--- trunk/Connections.cpp	(revision 10)
+++ trunk/Connections.cpp	(revision 10)
@@ -0,0 +1,130 @@
+// Connections.cpp: implementation of the CConnections class.
+//
+//////////////////////////////////////////////////////////////////////
+
+#include "stdafx.h"
+#include "Connections.h"
+
+#ifdef _DEBUG
+#undef THIS_FILE
+static char THIS_FILE[]=__FILE__;
+#define new DEBUG_NEW
+#endif
+
+
+IMPLEMENT_DYNAMIC( CConnections , CObject)
+
+
+//////////////////////////////////////////////////////////////////////
+// Construction/Destruction
+//////////////////////////////////////////////////////////////////////
+
+CConnections::CConnections()
+{
+
+}
+
+CConnections::~CConnections()
+{
+	RemoveAll();
+}
+
+CConnection* CConnections::Add(LPCTSTR sKey, WORD wType)
+{
+
+	CConnection* pConnection=NULL;
+
+	if (Lookup(sKey,pConnection)) {
+
+		ASSERT(FALSE);
+		return NULL;
+
+	}
+
+	pConnection = new CConnection(wType,sKey);
+
+	SetAt(sKey,pConnection);
+
+	return pConnection;
+}
+
+void CConnections::Remove(LPCTSTR sKey)
+{
+	CConnection* pConnection =NULL;
+	
+	if (Lookup(sKey,pConnection)) {
+
+		pConnection->Delete();
+
+		if (!RemoveKey(sKey)) {
+				ASSERT(FALSE);
+			}
+	
+	}
+
+
+}
+
+void CConnections::RemoveAll()
+{
+
+	POSITION pos;
+	CString sKey;
+	pos = GetStartPosition();
+	CConnection* pConnection;
+	
+	while (NULL!=pos) {
+		GetNextAssoc(pos,sKey,pConnection);
+		Remove(sKey);
+		pos = GetStartPosition();
+	}
+
+}
+
+void CConnections::Serialize( CArchive& archive )
+{
+	int iCount=0;
+	POSITION pos;
+	CString sKey;
+	CConnection* pConnection;
+	WORD wType;
+	int i=0;
+	
+	// call base class function first
+	// base class is CObject in this case
+	CObject::Serialize( archive );
+	
+	
+	// now do the stuff for our specific class
+	if( archive.IsStoring() ){
+		iCount=GetCount();
+		archive <<iCount;
+		
+		pos = GetStartPosition();
+		
+		while (NULL!=pos) {
+			GetNextAssoc(pos,sKey,pConnection);
+			//Serialize each connection 
+			archive <<sKey<< pConnection->Type();
+			pConnection->Serialize(archive);
+		}
+		
+	} 
+	
+	else {
+		archive >>iCount;
+		
+		for (i=0;i<iCount;i++){
+			archive >>sKey>>wType;
+			pConnection= Add(sKey,wType);
+			pConnection->Serialize(archive);
+			if (CConnection::AUTO==pConnection->Type()) {
+				if (!pConnection->AutoPtr()->m_pIModbusSrv) {
+					Remove(sKey);
+				}
+			}
+			
+		}
+	}
+	
+}
Index: trunk/Connections.h
===================================================================
--- trunk/Connections.h	(revision 10)
+++ trunk/Connections.h	(revision 10)
@@ -0,0 +1,28 @@
+// Connections.h: interface for the CConnections class.
+//
+//////////////////////////////////////////////////////////////////////
+
+#if !defined(AFX_CONNECTIONS_H__6DE30686_C724_11D1_8FE9_E4CD05C10000__INCLUDED_)
+#define AFX_CONNECTIONS_H__6DE30686_C724_11D1_8FE9_E4CD05C10000__INCLUDED_
+
+#if _MSC_VER >= 1000
+#pragma once
+#endif // _MSC_VER >= 1000
+
+#include "Connection.h"
+
+
+class CConnections : public CMap<CString,LPCTSTR ,CConnection*,CConnection*>  
+{
+	DECLARE_DYNAMIC(CConnections)
+public:
+	void Serialize( CArchive& archive );
+	void RemoveAll();
+	void Remove(LPCTSTR sKey);
+	CConnection* Add(LPCTSTR sKey, WORD wType);
+	CConnections();
+	virtual ~CConnections();
+	
+};
+
+#endif // !defined(AFX_CONNECTIONS_H__6DE30686_C724_11D1_8FE9_E4CD05C10000__INCLUDED_)
Index: trunk/DlgConnections.cpp
===================================================================
--- trunk/DlgConnections.cpp	(revision 10)
+++ trunk/DlgConnections.cpp	(revision 10)
@@ -0,0 +1,220 @@
+// DlgConnections.cpp : implementation file
+//
+
+#include "stdafx.h"
+#include "Modbucfg.h"
+#include "DlgConnections.h"
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+/////////////////////////////////////////////////////////////////////////////
+// CDlgConnections dialog
+
+
+CDlgConnections::CDlgConnections(CWnd* pParent /*=NULL*/)
+	: CDialog(CDlgConnections::IDD, pParent)
+{
+	//{{AFX_DATA_INIT(CDlgConnections)
+		// NOTE: the ClassWizard will add member initialization here
+	//}}AFX_DATA_INIT
+}
+
+
+void CDlgConnections::DoDataExchange(CDataExchange* pDX)
+{
+	CDialog::DoDataExchange(pDX);
+	//{{AFX_DATA_MAP(CDlgConnections)
+	DDX_Control(pDX, IDC_LST_CONNECTIOS, m_lstConnections);
+	DDX_Control(pDX, IDC_CMD_REMOVE, m_cmdRemove);
+	DDX_Control(pDX, IDC_CMD_EDIT, m_cmdEdit);
+	DDX_Control(pDX, IDC_CMD_ADD, m_cmdType);
+	DDX_Control(pDX, IDC_CBO_TYPE, m_cboType);
+	//}}AFX_DATA_MAP
+}
+
+
+BEGIN_MESSAGE_MAP(CDlgConnections, CDialog)
+	//{{AFX_MSG_MAP(CDlgConnections)
+	ON_BN_CLICKED(IDC_CMD_ADD, OnCmdAdd)
+	ON_BN_CLICKED(IDC_CMD_EDIT, OnCmdEdit)
+	ON_BN_CLICKED(IDC_CMD_REMOVE, OnCmdRemove)
+	ON_BN_CLICKED(IDC_BUTTON_SAVE, OnButtonSave)
+	ON_BN_CLICKED(IDC_BUTTON_LOAD, OnButtonLoad)
+	//}}AFX_MSG_MAP
+END_MESSAGE_MAP()
+
+/////////////////////////////////////////////////////////////////////////////
+// CDlgConnections message handlers
+
+void CDlgConnections::LoadControls()
+{
+	POSITION pos;
+	//new connection type 
+	m_cboType.ResetContent();
+	m_cboType.AddString(_T("Local/DCom"));
+	m_cboType.AddString(_T("Open Modbus"));
+	m_cboType.SetCurSel(0);
+	CString sKey;
+	CConnection* pConnection;
+
+	pos = gConnections.GetStartPosition();
+	
+	m_lstConnections.ResetContent();
+
+	while (NULL!=pos) {
+		gConnections.GetNextAssoc(pos,sKey,pConnection);
+		m_lstConnections.AddString(sKey);
+	}
+
+
+}
+
+BOOL CDlgConnections::OnInitDialog() 
+{
+	CDialog::OnInitDialog();
+	
+	LoadControls();	
+	return TRUE;  // return TRUE unless you set the focus to a control
+	              // EXCEPTION: OCX Property Pages should return FALSE
+}
+
+void CDlgConnections::OnCmdAdd() 
+{
+	int nIndex;
+	
+	CConnection* pConnection=NULL;
+	CCommParameters dlgComParameters;
+	CDlgRemoteParameters dlgRemoteParameters;
+	
+	nIndex = m_cboType.GetCurSel();
+
+	switch (nIndex) {
+	case 0: //Auto 
+		
+		dlgComParameters.m_bModeNew=TRUE;
+		dlgComParameters.Connection(NULL);
+		dlgComParameters.DoModal();
+		pConnection = dlgComParameters.Connection();
+		
+		break;
+		
+	case 1: //Remote
+		
+		dlgRemoteParameters.m_bModeNew=TRUE;
+		dlgRemoteParameters.Connection(NULL);
+		dlgRemoteParameters.DoModal();
+		pConnection = dlgRemoteParameters.Connection();
+		
+		break;
+	}
+
+
+	if (NULL!=pConnection) {
+		
+		m_lstConnections.AddString(pConnection->Key());
+	}
+	
+}
+
+void CDlgConnections::OnCmdEdit() 
+{
+	int nIndex;
+	CString sKey;
+	CConnection* pConnection =NULL;
+	CCommParameters dlgComParameters;
+	CDlgRemoteParameters dlgRemoteParameters;
+	
+	nIndex = m_lstConnections.GetCurSel();
+	
+	if (nIndex>=0) {
+		m_lstConnections.GetText(nIndex,sKey);
+		
+		if (gConnections.Lookup(sKey,pConnection)) {
+			
+			switch (pConnection->Type()) {
+				
+			case CConnection::AUTO:
+				dlgComParameters.m_bModeNew=FALSE;
+				dlgComParameters.Connection(pConnection);
+				dlgComParameters.DoModal();
+				break; 
+			case CConnection::REMOTE:
+				dlgRemoteParameters.m_bModeNew=FALSE;
+				dlgRemoteParameters.Connection(pConnection);
+				dlgRemoteParameters.DoModal();
+				break;
+			default:
+				ASSERT(FALSE);
+				
+			}
+		}
+		
+	}
+	
+}
+
+void CDlgConnections::OnCmdRemove() 
+{
+	int nIndex;
+	CString sKey;
+	int iResp;
+		
+	nIndex = m_lstConnections.GetCurSel();
+	
+	if (nIndex>=0) {
+		m_lstConnections.GetText(nIndex,sKey);
+		iResp=AfxMessageBox(_T("Remove connection ")+sKey,MB_YESNO);
+		if (IDYES==iResp)  {
+				gConnections.Remove(sKey);
+				m_lstConnections.DeleteString(nIndex);
+		}
+		
+	}
+	
+}
+
+void CDlgConnections::OnButtonSave() 
+{
+	CFile fileCfg;
+	
+	if (fileCfg.Open("Modbu.cfg",CFile::modeCreate|CFile::modeWrite)){
+		
+		CArchive archConfig(&fileCfg,CArchive::store);
+		gConnections.Serialize(archConfig);
+		archConfig.Close();
+		fileCfg.Close();
+	}	
+}
+
+void CDlgConnections::OnButtonLoad() 
+{
+
+	CFile fileCfg;
+
+	gConnections.RemoveAll();
+
+	if (fileCfg.Open("Modbu.cfg",CFile::modeRead)){
+		
+		try {
+			CArchive archConfig(&fileCfg,CArchive::load);
+			gConnections.Serialize(archConfig);
+			archConfig.Close();
+
+			LoadControls();
+		}
+		
+		catch( CException* e )
+		{
+			// Handle the exception here.
+			// "e" contains information about the exception.
+			e->Delete();
+			
+		}//end catch
+		
+		fileCfg.Close(); 
+	}
+}
Index: trunk/DlgConnections.h
===================================================================
--- trunk/DlgConnections.h	(revision 10)
+++ trunk/DlgConnections.h	(revision 10)
@@ -0,0 +1,66 @@
+#if !defined(AFX_DLGCONNECTIONS_H__4D342E25_FE27_11D1_8FE9_68D504C1BC01__INCLUDED_)
+#define AFX_DLGCONNECTIONS_H__4D342E25_FE27_11D1_8FE9_68D504C1BC01__INCLUDED_
+
+#if _MSC_VER >= 1000
+#pragma once
+#endif // _MSC_VER >= 1000
+// DlgConnections.h : header file
+//
+
+/////////////////////////////////////////////////////////////////////////////
+// CDlgConnections dialog
+
+#include "globals.h"
+
+#include "CommParameters.h"
+
+#include "DlgRemoteParameters.h"
+
+class CDlgConnections : public CDialog
+{
+// Construction
+public:
+	void LoadControls();
+	CDlgConnections(CWnd* pParent = NULL);   // standard constructor
+
+// Dialog Data
+	//{{AFX_DATA(CDlgConnections)
+	enum { IDD = IDD_CONNECTIONS };
+	CListBox	m_lstConnections;
+	CButton	m_cmdRemove;
+	CButton	m_cmdEdit;
+	CButton	m_cmdType;
+	CComboBox	m_cboType;
+	//}}AFX_DATA
+
+
+// Overrides
+	// ClassWizard generated virtual function overrides
+	//{{AFX_VIRTUAL(CDlgConnections)
+	protected:
+	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
+	//}}AFX_VIRTUAL
+
+	enum _General_DlgConnections_Constants_ {
+		LOCAL_DCOM=0,
+		OPEN_MODBUS=1	
+	};
+// Implementation
+protected:
+
+	// Generated message map functions
+	//{{AFX_MSG(CDlgConnections)
+	virtual BOOL OnInitDialog();
+	afx_msg void OnCmdAdd();
+	afx_msg void OnCmdEdit();
+	afx_msg void OnCmdRemove();
+	afx_msg void OnButtonSave();
+	afx_msg void OnButtonLoad();
+	//}}AFX_MSG
+	DECLARE_MESSAGE_MAP()
+};
+
+//{{AFX_INSERT_LOCATION}}
+// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
+
+#endif // !defined(AFX_DLGCONNECTIONS_H__4D342E25_FE27_11D1_8FE9_68D504C1BC01__INCLUDED_)
Index: trunk/DlgRemoteParameters.cpp
===================================================================
--- trunk/DlgRemoteParameters.cpp	(revision 10)
+++ trunk/DlgRemoteParameters.cpp	(revision 10)
@@ -0,0 +1,211 @@
+// DlgRemoteParameters.cpp : implementation file
+//
+
+#include "stdafx.h"
+#include "Modbucfg.h"
+#include "DlgRemoteParameters.h"
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+/////////////////////////////////////////////////////////////////////////////
+// CDlgRemoteParameters dialog
+
+
+CDlgRemoteParameters::CDlgRemoteParameters(CWnd* pParent /*=NULL*/)
+	: CDialog(CDlgRemoteParameters::IDD, pParent)
+{
+	m_bModeNew=FALSE;
+	m_pConnection=NULL;
+
+	//{{AFX_DATA_INIT(CDlgRemoteParameters)
+	//}}AFX_DATA_INIT
+}
+
+
+void CDlgRemoteParameters::DoDataExchange(CDataExchange* pDX)
+{
+	CDialog::DoDataExchange(pDX);
+	//{{AFX_DATA_MAP(CDlgRemoteParameters)
+	DDX_Control(pDX, IDC_EDIT_TIME_OUT, m_edtTimeOut);
+	DDX_Control(pDX, IDC_EDIT_PORT, m_edtServerPort);
+	DDX_Control(pDX, IDC_EDIT_IP_ADDR, m_edtServerAddress);
+	//}}AFX_DATA_MAP
+}
+
+
+BEGIN_MESSAGE_MAP(CDlgRemoteParameters, CDialog)
+	//{{AFX_MSG_MAP(CDlgRemoteParameters)
+	ON_BN_CLICKED(IDOKey, OnOKey)
+	//}}AFX_MSG_MAP
+END_MESSAGE_MAP()
+
+
+void CDlgRemoteParameters::Connection(CConnection* pConnection)
+{
+	m_pConnection = pConnection;
+}
+
+CConnection* CDlgRemoteParameters::Connection(){
+  
+	return m_pConnection;
+}
+
+
+
+BOOL CDlgRemoteParameters::ShowParameters()
+{
+	
+	ASSERT(m_pConnection);
+
+	CRemoteModbus* pRemoteModbus = m_pConnection->RemotePtr();
+
+	CString str;
+
+	m_edtServerAddress.SetWindowText(pRemoteModbus->Host());
+
+	str.Format("%d",pRemoteModbus->Port());
+
+	m_edtServerPort.SetWindowText(str);
+
+	str.Format("%d",pRemoteModbus->Timeout());
+
+	m_edtTimeOut.SetWindowText(str);
+
+	if (!m_bModeNew) {
+		m_edtServerPort.EnableWindow(FALSE);
+		m_edtServerAddress.EnableWindow(FALSE);
+	}
+
+	return TRUE;
+}
+
+BOOL CDlgRemoteParameters::SaveParameters()
+{
+	  
+	DWORD dwTimeout;
+	  
+	  CString str;
+	  CString sConnectionName;
+	  CString sMachine;
+	  
+	  CRemoteModbus* pRemoteModbus=NULL;	
+	 
+	  UpdateData(TRUE);
+
+	  
+	  if (m_bModeNew) {
+		  
+		  m_edtServerPort.GetWindowText(str);
+		  str.TrimLeft();
+		  str.TrimRight();
+		  
+		  m_edtServerAddress.GetWindowText(sMachine);
+		  
+		  sMachine.TrimLeft();
+		  sMachine.TrimRight();
+		 		  
+		  sConnectionName = sMachine + _T(":") + str;
+		  
+		  if (gConnections.Lookup(sConnectionName,m_pConnection)) {
+				AfxMessageBox("Connection Alredy Exist");
+				Connection(NULL);
+				return FALSE;
+		  }
+
+		  
+		  m_pConnection= gConnections.Add(sConnectionName, CConnection::REMOTE);
+		  
+		  if (NULL==m_pConnection) {
+			   AfxMessageBox("Error Adding Connection");
+			   return FALSE;
+		  }
+
+		  pRemoteModbus=m_pConnection->RemotePtr();
+	
+		  
+	  }
+	  else {
+
+		  //edit connection 
+		  ASSERT(m_pConnection);
+		  pRemoteModbus= m_pConnection->RemotePtr();
+	  
+	  }
+	  
+	  
+	  //timeout 
+	  m_edtTimeOut.GetWindowText(str);
+	  dwTimeout=(DWORD)atol(str);
+	  if (0==dwTimeout) {
+		  AfxMessageBox("Invalid timeout");
+		  goto ParamError;
+	  }
+	  
+	  pRemoteModbus->Timeout(dwTimeout);
+
+
+	  //host
+	  m_edtServerAddress.GetWindowText(str);
+	  pRemoteModbus->Host(str);
+	  
+	  //port 	
+	  m_edtServerPort.GetWindowText(str);
+	  pRemoteModbus->Port((WORD)atol(str));
+
+	  
+	  pRemoteModbus->ReconnectOnEveryMessage(TRUE);
+
+	  if (!pRemoteModbus->openConnection()) {
+		  AfxMessageBox("Connection Error");
+		  goto ParamError;
+	  }
+
+	  return (TRUE);
+
+ParamError:
+	if (m_bModeNew) {
+		gConnections.Remove(sConnectionName); //Remove New Connection 
+		Connection(NULL);
+	}
+	 return (FALSE);
+}
+
+/////////////////////////////////////////////////////////////////////////////
+// CDlgRemoteParameters message handlers
+
+
+
+void CDlgRemoteParameters::OnCancel() 
+{
+	// TODO: Add extra cleanup here
+	
+	CDialog::OnCancel();
+}
+
+
+
+BOOL CDlgRemoteParameters::OnInitDialog() 
+{
+	CDialog::OnInitDialog();
+	
+	// TODO: Add extra initialization here
+
+	if (!m_bModeNew) {
+		ShowParameters();
+	}
+	
+	return TRUE;  // return TRUE unless you set the focus to a control
+	              // EXCEPTION: OCX Property Pages should return FALSE
+}
+
+void CDlgRemoteParameters::OnOKey() 
+{
+	if (SaveParameters()) {
+		CDialog::OnOK();
+	}
+	
+}
Index: trunk/DlgRemoteParameters.h
===================================================================
--- trunk/DlgRemoteParameters.h	(revision 10)
+++ trunk/DlgRemoteParameters.h	(revision 10)
@@ -0,0 +1,64 @@
+#if !defined(AFX_DLGREMOTEPARAMETERS_H__2283C162_0041_11D2_8FE9_68D504C1BC01__INCLUDED_)
+#define AFX_DLGREMOTEPARAMETERS_H__2283C162_0041_11D2_8FE9_68D504C1BC01__INCLUDED_
+
+#if _MSC_VER >= 1000
+#pragma once
+#endif // _MSC_VER >= 1000
+// DlgRemoteParameters.h : header file
+
+//
+
+#include "Globals.h"
+
+/////////////////////////////////////////////////////////////////////////////
+// CDlgRemoteParameters dialog
+
+class CDlgRemoteParameters : public CDialog
+{
+// Construction
+public:
+	CDlgRemoteParameters(CWnd* pParent = NULL);   // standard constructor
+
+	BOOL SaveParameters();
+	void Connection(CConnection* pConnection);
+	CConnection* Connection();
+	BOOL ShowParameters();
+	//CCommParameters(CWnd* pParent = NULL);   // standard constructor
+
+	BOOL m_bModeNew;
+
+// Dialog Data
+	//{{AFX_DATA(CDlgRemoteParameters)
+	enum { IDD = IDD_MOD_REM_PARAMETERS };
+	CEdit	m_edtTimeOut;
+	CEdit	m_edtServerPort;
+	CEdit	m_edtServerAddress;
+	//}}AFX_DATA
+
+
+// Overrides
+	// ClassWizard generated virtual function overrides
+	//{{AFX_VIRTUAL(CDlgRemoteParameters)
+	protected:
+	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
+	//}}AFX_VIRTUAL
+
+// Implementation
+protected:
+
+	// Generated message map functions
+	//{{AFX_MSG(CDlgRemoteParameters)
+	virtual void OnCancel();
+	virtual BOOL OnInitDialog();
+	afx_msg void OnOKey();
+	//}}AFX_MSG
+	DECLARE_MESSAGE_MAP()
+
+private:
+	CConnection* m_pConnection;
+};
+
+//{{AFX_INSERT_LOCATION}}
+// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
+
+#endif // !defined(AFX_DLGREMOTEPARAMETERS_H__2283C162_0041_11D2_8FE9_68D504C1BC01__INCLUDED_)
Index: trunk/Globals.cpp
===================================================================
--- trunk/Globals.cpp	(revision 10)
+++ trunk/Globals.cpp	(revision 10)
@@ -0,0 +1,14 @@
+// Globals.cpp: implementation of the Globals class.
+//
+//////////////////////////////////////////////////////////////////////
+
+#include "stdafx.h"
+#include "Globals.h"
+
+#ifdef _DEBUG
+#undef THIS_FILE
+static char THIS_FILE[]=__FILE__;
+#define new DEBUG_NEW
+#endif
+
+CConnections gConnections;
Index: trunk/Globals.h
===================================================================
--- trunk/Globals.h	(revision 10)
+++ trunk/Globals.h	(revision 10)
@@ -0,0 +1,17 @@
+// Globals.h: interface for the Globals class.
+//
+//////////////////////////////////////////////////////////////////////
+
+#if !defined(AFX_GLOBALS_H__598A7321_F984_11D1_9E7B_08C003C10000__INCLUDED_)
+#define AFX_GLOBALS_H__598A7321_F984_11D1_9E7B_08C003C10000__INCLUDED_
+
+#if _MSC_VER >= 1000
+#pragma once
+#endif // _MSC_VER >= 1000
+
+#include "Connections.h"
+
+extern CConnections gConnections;
+
+
+#endif // !defined(AFX_GLOBALS_H__598A7321_F984_11D1_9E7B_08C003C10000__INCLUDED_)
Index: trunk/MainFrm.cpp
===================================================================
--- trunk/MainFrm.cpp	(revision 10)
+++ trunk/MainFrm.cpp	(revision 10)
@@ -0,0 +1,251 @@
+// MainFrm.cpp : implementation of the CMainFrame class
+//
+
+#include "stdafx.h"
+#include "Modbucfg.h"
+
+#include "MainFrm.h"
+
+#include "Globals.h"
+
+#include "CommParameters.h"
+
+#include "DlgConnections.h"
+#include "Splash.h"
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+/////////////////////////////////////////////////////////////////////////////
+// CMainFrame
+
+// Message ID used for tray notifications
+#define WM_MY_TRAY_NOTIFICATION WM_USER+0
+
+
+IMPLEMENT_DYNAMIC(CMainFrame, CMDIFrameWnd)
+
+BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd)
+	ON_MESSAGE(WM_MY_TRAY_NOTIFICATION, OnTrayNotification)
+	//{{AFX_MSG_MAP(CMainFrame)
+	ON_WM_CREATE()
+	ON_COMMAND(ID_OPTIONS_CONNECTIONS, OnOptionsConnections)
+	ON_COMMAND(ID_TRAY_MAIN, OnTrayMain)
+	ON_COMMAND(ID_TRAY_CONNECTIONS, OnTrayConnections)
+	ON_WM_SHOWWINDOW()
+	ON_WM_CLOSE()
+	ON_COMMAND(ID_TRAY_EXIT, OnTrayExit)
+	ON_WM_SIZE()
+	ON_COMMAND(ID_OPTIONS_REGISTERTYPELIBRARY, OnOptionsRegistertypeLibrary)
+	//}}AFX_MSG_MAP
+END_MESSAGE_MAP()
+
+static UINT indicators[] =
+{
+	ID_SEPARATOR,           // status line indicator
+	ID_INDICATOR_CAPS,
+	ID_INDICATOR_NUM,
+	ID_INDICATOR_SCRL,
+};
+
+/////////////////////////////////////////////////////////////////////////////
+// CMainFrame construction/destruction
+
+CMainFrame::CMainFrame(): m_trayIcon(IDR_TRAY_ICON)
+{
+	m_bTeminate=FALSE;
+	m_bConfiguringConnections=FALSE;
+	
+}
+
+CMainFrame::~CMainFrame()
+{
+}
+
+int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
+{
+	if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
+		return -1;
+	
+	if (!m_wndToolBar.Create(this) ||
+		!m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
+	{
+		TRACE0("Failed to create toolbar\n");
+		return -1;      // fail to create
+	}
+
+	if (!m_wndStatusBar.Create(this) ||
+		!m_wndStatusBar.SetIndicators(indicators,
+		  sizeof(indicators)/sizeof(UINT)))
+	{
+		TRACE0("Failed to create status bar\n");
+		return -1;      // fail to create
+	}
+
+	// TODO: Remove this if you don't want tool tips or a resizeable toolbar
+	m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() |
+		CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
+
+	// TODO: Delete these three lines if you don't want the toolbar to
+	//  be dockable
+	m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
+	EnableDocking(CBRS_ALIGN_ANY);
+	DockControlBar(&m_wndToolBar);
+
+	// CG: The following line was added by the Splash Screen component.
+	CSplashWnd::ShowSplashScreen(this);
+
+	// Set up tray icon
+	m_trayIcon.SetNotificationWnd(this, WM_MY_TRAY_NOTIFICATION);
+	m_trayIcon.SetIcon(NULL);
+	m_bTeminate=FALSE;
+
+	return 0;
+}
+
+BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
+{
+	// TODO: Modify the Window class or styles here by modifying
+	//  the CREATESTRUCT cs
+
+	return CMDIFrameWnd::PreCreateWindow(cs);
+}
+
+/////////////////////////////////////////////////////////////////////////////
+// CMainFrame diagnostics
+
+#ifdef _DEBUG
+void CMainFrame::AssertValid() const
+{
+	CMDIFrameWnd::AssertValid();
+}
+
+void CMainFrame::Dump(CDumpContext& dc) const
+{
+	CMDIFrameWnd::Dump(dc);
+}
+
+#endif //_DEBUG
+
+/////////////////////////////////////////////////////////////////////////////
+// CMainFrame message handlers
+
+
+void CMainFrame::OnOptionsConnections() 
+{
+	CMDIChildWnd* pChildWnd=MDIGetActive();
+	CDlgConnections	dlgConnections;
+	
+	if (pChildWnd!=NULL){
+		ShowWindow(SW_SHOWNORMAL);
+		AfxMessageBox("Close All documents before configuring connections");
+		return;
+	}
+	
+	m_bConfiguringConnections=TRUE;
+	dlgConnections.DoModal();
+	m_bConfiguringConnections=FALSE;	
+}
+
+// Handle notification from tray icon: display a message.
+//
+LRESULT CMainFrame::OnTrayNotification(WPARAM uID, LPARAM lEvent)
+{
+
+	// let tray icon do default stuff
+	return m_trayIcon.OnTrayNotification(uID, lEvent);
+}
+
+
+void CMainFrame::OnTrayMain() 
+{
+	// The main window has been initialized, so show and update it.
+	ShowWindow(SW_SHOWNORMAL);
+	
+}
+
+void CMainFrame::OnTrayConnections() 
+{
+
+	if (m_bConfiguringConnections) {
+		return;
+	}
+
+	OnOptionsConnections();
+
+	
+}
+
+void CMainFrame::OnShowWindow(BOOL bShow, UINT nStatus) 
+{
+	CMDIFrameWnd::OnShowWindow(bShow, nStatus);
+	
+	// TODO: Add your message handler code here
+	
+}
+
+void CMainFrame::OnClose() 
+{
+	// TODO: Add your message handler code here and/or call default
+	//ShowWindow(SW_HIDE);
+	CMDIFrameWnd::OnClose();
+}
+
+void CMainFrame::OnTrayExit() 
+{
+	// TODO: Add your command handler code here
+	CMDIFrameWnd::OnClose();
+	
+}
+
+void CMainFrame::OnSize(UINT nType, int cx, int cy) 
+{
+	
+	
+	CMDIFrameWnd::OnSize(nType, cx, cy);
+
+	if (SIZE_MINIMIZED==nType) {
+		ShowWindow(SW_HIDE);
+		m_trayIcon.SetIcon(IDR_TRAY_ICON);
+	}
+	else {
+		m_trayIcon.SetIcon(NULL);
+	}
+	
+	
+		
+}
+
+void CMainFrame::OnOptionsRegistertypeLibrary() 
+{
+
+ CString sFilter;
+	
+
+ sFilter="Library Files (*.tlb)|*.tlb|All Files (*.*)|*.*||";
+
+ CFileDialog  fileLib( TRUE, 
+	                   NULL, 
+					   NULL, 
+					   OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, 
+					   sFilter, 
+					   (CWnd*)this);
+
+
+ if (IDOK==fileLib.DoModal()) {
+		
+	 if (!RegTypeLib(fileLib.GetPathName())) {
+
+          AfxMessageBox("Library registred failed");
+	 }
+	 else {
+		 AfxMessageBox("Library registred");
+	 }
+ 
+ }
+
+
+}
Index: trunk/MainFrm.h
===================================================================
--- trunk/MainFrm.h	(revision 10)
+++ trunk/MainFrm.h	(revision 10)
@@ -0,0 +1,71 @@
+// MainFrm.h : interface of the CMainFrame class
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#if !defined(AFX_MAINFRM_H__A3BAD4AF_F5AE_11D1_8FE9_6CD504C1BC01__INCLUDED_)
+#define AFX_MAINFRM_H__A3BAD4AF_F5AE_11D1_8FE9_6CD504C1BC01__INCLUDED_
+
+#if _MSC_VER >= 1000
+#pragma once
+#endif // _MSC_VER >= 1000
+
+#include "trayicon.h"
+
+class CMainFrame : public CMDIFrameWnd
+{
+	DECLARE_DYNAMIC(CMainFrame)
+public:
+	CMainFrame();
+
+// Attributes
+public:
+
+// Operations
+public:
+
+// Overrides
+	// ClassWizard generated virtual function overrides
+	//{{AFX_VIRTUAL(CMainFrame)
+	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
+	//}}AFX_VIRTUAL
+
+// Implementation
+public:
+	virtual ~CMainFrame();
+#ifdef _DEBUG
+	virtual void AssertValid() const;
+	virtual void Dump(CDumpContext& dc) const;
+#endif
+
+protected:  // control bar embedded members
+	CStatusBar  m_wndStatusBar;
+	CToolBar    m_wndToolBar;
+
+	CTrayIcon	m_trayIcon;		// my tray icon
+
+// Generated message map functions
+protected:
+	afx_msg LRESULT OnTrayNotification(WPARAM wp, LPARAM lp);
+	//{{AFX_MSG(CMainFrame)
+	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
+	afx_msg void OnOptionsConnections();
+	afx_msg void OnTrayMain();
+	afx_msg void OnTrayConnections();
+	afx_msg void OnShowWindow(BOOL bShow, UINT nStatus);
+	afx_msg void OnClose();
+	afx_msg void OnTrayExit();
+	afx_msg void OnSize(UINT nType, int cx, int cy);
+	afx_msg void OnOptionsRegistertypeLibrary();
+	//}}AFX_MSG
+	DECLARE_MESSAGE_MAP()
+private:
+	BOOL m_bConfiguringConnections;
+	BOOL m_bTeminate;
+};
+
+/////////////////////////////////////////////////////////////////////////////
+
+//{{AFX_INSERT_LOCATION}}
+// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
+
+#endif // !defined(AFX_MAINFRM_H__A3BAD4AF_F5AE_11D1_8FE9_6CD504C1BC01__INCLUDED_)
Index: trunk/Modbucfg.001
===================================================================
--- trunk/Modbucfg.001	(revision 10)
+++ trunk/Modbucfg.001	(revision 10)
@@ -0,0 +1,255 @@
+# Microsoft Developer Studio Project File - Name="Modbucfg" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 5.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Application" 0x0101
+
+CFG=Modbucfg - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "Modbucfg.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "Modbucfg.mak" CFG="Modbucfg - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "Modbucfg - Win32 Release" (based on "Win32 (x86) Application")
+!MESSAGE "Modbucfg - Win32 Debug" (based on "Win32 (x86) Application")
+!MESSAGE 
+
+# Begin Project
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "Modbucfg - Win32 Release"
+
+# PROP BASE Use_MFC 6
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 6
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\UtilClasses\Include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
+# ADD BASE RSC /l 0x416 /d "NDEBUG" /d "_AFXDLL"
+# ADD RSC /l 0x416 /d "NDEBUG" /d "_AFXDLL"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 /nologo /subsystem:windows /machine:I386
+# ADD LINK32 winmm.lib /nologo /subsystem:windows /machine:I386 /libpath:"..\ModbuLib"
+
+!ELSEIF  "$(CFG)" == "Modbucfg - Win32 Debug"
+
+# PROP BASE Use_MFC 6
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 6
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\UtilClasses\Include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
+# ADD BASE RSC /l 0x416 /d "_DEBUG" /d "_AFXDLL"
+# ADD RSC /l 0x416 /d "_DEBUG" /d "_AFXDLL"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept /libpath:"..\ModbuLib"
+
+!ENDIF 
+
+# Begin Target
+
+# Name "Modbucfg - Win32 Release"
+# Name "Modbucfg - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\ChildFrm.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\CommParameters.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\Connection.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\Connections.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\DlgConnections.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\DlgRemoteParameters.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\Globals.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\MainFrm.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\Modbucfg.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\Modbucfg.rc
+# End Source File
+# Begin Source File
+
+SOURCE=.\ModbucfgDoc.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\ModbucfgView.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\Splash.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\StdAfx.cpp
+# ADD CPP /Yc"stdafx.h"
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=.\ChildFrm.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\CommParameters.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\Connection.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\Connections.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\DlgConnections.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\DlgRemoteParameters.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\Globals.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\MainFrm.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\Modbucfg.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\ModbucfgDoc.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\ModbucfgView.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\Resource.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\Splash.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\StdAfx.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe"
+# Begin Source File
+
+SOURCE=.\res\idr_tray.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\res\Modbucfg.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\res\Modbucfg.rc2
+# End Source File
+# Begin Source File
+
+SOURCE=.\res\ModbucfgDoc.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\Splsh16.bmp
+# End Source File
+# Begin Source File
+
+SOURCE=.\res\Toolbar.bmp
+# End Source File
+# End Group
+# Begin Source File
+
+SOURCE=.\Modbucfg.reg
+# End Source File
+# Begin Source File
+
+SOURCE=.\Modifications.txt
+# End Source File
+# Begin Source File
+
+SOURCE=.\ReadMe.txt
+# End Source File
+# End Target
+# End Project
+# Section Modbucfg : {00000000-0000-0000-0000-000000000000}
+# 	1:10:IDB_SPLASH:102
+# 	2:21:SplashScreenInsertKey:4.0
+# End Section
Index: trunk/Modbucfg.clw
===================================================================
--- trunk/Modbucfg.clw	(revision 10)
+++ trunk/Modbucfg.clw	(revision 10)
@@ -0,0 +1,366 @@
+; CLW file contains information for the MFC ClassWizard
+
+[General Info]
+Version=1
+LastClass=CCommParameters
+LastTemplate=CDialog
+NewFileInclude1=#include "stdafx.h"
+NewFileInclude2=#include "Modbucfg.h"
+ODLFile=Modbucfg.odl
+LastPage=0
+
+ClassCount=10
+Class1=CModbucfgApp
+Class2=CModbucfgDoc
+Class3=CModbucfgView
+Class4=CMainFrame
+
+ResourceCount=12
+Resource1=IDD_ABOUTBOX
+Resource2=IDR_MAINFRAME
+Resource3=IDR_MODBUCTYPE
+Resource7=IDD_ABOUTBOX (English (U.S.))
+Resource4=IDD_MODBUCFG_FORM
+Resource5=IDD_MODBUCFG_FORM (English (U.S.))
+Resource6=IDR_MODBUCTYPE (English (U.S.))
+Resource8=IDR_MAINFRAME (English (U.S.))
+Class5=CAboutDlg
+Class6=CChildFrame
+Class7=CCommParameters
+Resource9=IDD_MOD_LOCAL_COM_PARAM (English (U.S.))
+Class8=CDlgConnections
+Resource10=IDD_CONNECTIONS (English (U.S.))
+Class9=CDlgRemoteParameters
+Class10=CSplashWnd
+Resource11=IDR_TRAY_ICON (English (U.S.))
+Resource12=IDD_MOD_REM_PARAMETERS
+
+[CLS:CModbucfgApp]
+Type=0
+HeaderFile=Modbucfg.h
+ImplementationFile=Modbucfg.cpp
+Filter=N
+LastObject=ID_TRAY_EXIT
+
+[CLS:CModbucfgDoc]
+Type=0
+HeaderFile=ModbucfgDoc.h
+ImplementationFile=ModbucfgDoc.cpp
+Filter=N
+LastObject=CModbucfgDoc
+BaseClass=CDocument
+VirtualFilter=DC
+
+[CLS:CModbucfgView]
+Type=0
+HeaderFile=ModbucfgView.h
+ImplementationFile=ModbucfgView.cpp
+Filter=D
+LastObject=CModbucfgView
+BaseClass=CFormView
+VirtualFilter=VWC
+
+[CLS:CMainFrame]
+Type=0
+HeaderFile=MainFrm.h
+ImplementationFile=MainFrm.cpp
+Filter=T
+BaseClass=CMDIFrameWnd
+VirtualFilter=fWC
+LastObject=ID_OPTIONS_REGISTERTYPELIBRARY
+
+
+[CLS:CChildFrame]
+Type=0
+HeaderFile=ChildFrm.h
+ImplementationFile=ChildFrm.cpp
+Filter=M
+
+[CLS:CAboutDlg]
+Type=0
+HeaderFile=Modbucfg.cpp
+ImplementationFile=Modbucfg.cpp
+Filter=D
+
+[DLG:IDD_ABOUTBOX]
+Type=1
+ControlCount=4
+Control1=IDC_STATIC,static,1342177283
+Control2=IDC_STATIC,static,1342308352
+Control3=IDC_STATIC,static,1342308352
+Control4=IDOK,button,1342373889
+Class=CAboutDlg
+
+[MNU:IDR_MAINFRAME]
+Type=1
+Class=CMainFrame
+Command1=ID_FILE_NEW
+Command2=ID_FILE_OPEN
+Command4=ID_APP_EXIT
+Command5=ID_VIEW_TOOLBAR
+Command6=ID_VIEW_STATUS_BAR
+Command7=ID_APP_ABOUT
+CommandCount=7
+Command3=ID_FILE_MRU_FILE1
+
+[TB:IDR_MAINFRAME]
+Type=1
+Class=CMainFrame
+Command1=ID_FILE_NEW
+Command2=ID_FILE_OPEN
+Command3=ID_FILE_SAVE
+Command4=ID_EDIT_CUT
+Command5=ID_EDIT_COPY
+Command6=ID_EDIT_PASTE
+Command7=ID_FILE_PRINT
+CommandCount=8
+Command8=ID_APP_ABOUT
+
+[MNU:IDR_MODBUCTYPE]
+Type=1
+Class=CModbucfgView
+Command1=ID_FILE_NEW
+Command2=ID_FILE_OPEN
+Command3=ID_FILE_CLOSE
+Command4=ID_FILE_SAVE
+Command5=ID_FILE_SAVE_AS
+Command9=ID_EDIT_CUT
+Command10=ID_EDIT_COPY
+Command11=ID_EDIT_PASTE
+Command12=ID_VIEW_TOOLBAR
+Command13=ID_VIEW_STATUS_BAR
+Command14=ID_WINDOW_NEW
+CommandCount=18
+Command6=ID_FILE_MRU_FILE1
+Command7=ID_APP_EXIT
+Command8=ID_EDIT_UNDO
+Command15=ID_WINDOW_CASCADE
+Command16=ID_WINDOW_TILE_HORZ
+Command17=ID_WINDOW_ARRANGE
+Command18=ID_APP_ABOUT
+
+[ACL:IDR_MAINFRAME]
+Type=1
+Class=CMainFrame
+Command1=ID_FILE_NEW
+Command2=ID_FILE_OPEN
+Command3=ID_FILE_SAVE
+Command5=ID_EDIT_CUT
+Command6=ID_EDIT_COPY
+Command7=ID_EDIT_PASTE
+Command8=ID_EDIT_UNDO
+Command9=ID_EDIT_CUT
+Command10=ID_EDIT_COPY
+Command11=ID_EDIT_PASTE
+Command12=ID_NEXT_PANE
+CommandCount=13
+Command4=ID_EDIT_UNDO
+Command13=ID_PREV_PANE
+
+[DLG:IDD_MODBUCFG_FORM]
+Type=1
+Class=CModbucfgView
+
+[DLG:IDD_MODBUCFG_FORM (English (U.S.))]
+Type=1
+Class=CModbucfgView
+ControlCount=26
+Control1=IDC_FRA_MOD_WRITE_FUNCTIONS,button,1342177287
+Control2=IDC_STATIC,button,1342177287
+Control3=IDC_CBO_READ_FUNCTION,combobox,1344339971
+Control4=IDC_STATIC,static,1342308352
+Control5=IDC_EDIT_DEVICE,edit,1350639744
+Control6=IDC_STATIC,static,1342308352
+Control7=IDC_EDIT_ADDR,edit,1350639744
+Control8=IDC_STATIC,static,1342308352
+Control9=IDC_EDIT_QUANT,edit,1350639744
+Control10=IDC_STATIC,button,1342308359
+Control11=IDC_CHK_Enable_Poll,button,1342242819
+Control12=IDC_STAT_STATUS,static,1350696972
+Control13=IDC_STATIC,static,1342308352
+Control14=IDC_EDIT_VALUE,edit,1350631552
+Control15=IDC_CMD_WRITE,button,1342242816
+Control16=IDC_CBO_WRITE_FUNCTION,combobox,1344339971
+Control17=IDC_STAT_ERROR,static,1350696972
+Control18=IDC_STATIC,static,1342308352
+Control19=IDC_EDIT_ADDR_WRI,edit,1350639744
+Control20=IDC_LST_VALUES,listbox,1352728835
+Control21=IDC_FRA_MOD_FUNCTIONS2,button,1342177287
+Control22=IDC_CBO_CONNECTION,combobox,1344339971
+Control23=IDC_STATIC,static,1342308352
+Control24=IDC_EDIT_INTERVAL,edit,1350631552
+Control25=IDC_STATIC,static,1342308352
+Control26=IDC_CBO_DATA_TYPE,combobox,1344339971
+
+[TB:IDR_MAINFRAME (English (U.S.))]
+Type=1
+Class=?
+Command1=ID_FILE_NEW
+Command2=ID_APP_ABOUT
+CommandCount=2
+
+[MNU:IDR_MAINFRAME (English (U.S.))]
+Type=1
+Class=CMainFrame
+Command1=ID_FILE_NEW
+Command2=ID_APP_EXIT
+Command3=ID_VIEW_TOOLBAR
+Command4=ID_VIEW_STATUS_BAR
+Command5=ID_OPTIONS_CONNECTIONS
+Command6=ID_OPTIONS_REGISTERTYPELIBRARY
+Command7=ID_APP_ABOUT
+CommandCount=7
+
+[MNU:IDR_MODBUCTYPE (English (U.S.))]
+Type=1
+Class=?
+Command1=ID_FILE_NEW
+Command2=ID_FILE_CLOSE
+Command3=ID_APP_EXIT
+Command4=ID_VIEW_TOOLBAR
+Command5=ID_VIEW_STATUS_BAR
+Command6=ID_WINDOW_NEW
+Command7=ID_WINDOW_CASCADE
+Command8=ID_WINDOW_TILE_HORZ
+Command9=ID_WINDOW_ARRANGE
+Command10=ID_APP_ABOUT
+CommandCount=10
+
+[ACL:IDR_MAINFRAME (English (U.S.))]
+Type=1
+Class=?
+Command1=ID_FILE_NEW
+Command2=ID_FILE_OPEN
+Command3=ID_FILE_SAVE
+Command4=ID_EDIT_UNDO
+Command5=ID_EDIT_CUT
+Command6=ID_EDIT_COPY
+Command7=ID_EDIT_PASTE
+Command8=ID_EDIT_UNDO
+Command9=ID_EDIT_CUT
+Command10=ID_EDIT_COPY
+Command11=ID_EDIT_PASTE
+Command12=ID_NEXT_PANE
+Command13=ID_PREV_PANE
+CommandCount=13
+
+[DLG:IDD_ABOUTBOX (English (U.S.))]
+Type=1
+Class=CAboutDlg
+ControlCount=4
+Control1=IDC_STATIC,static,1342177283
+Control2=IDC_STATIC,static,1342308480
+Control3=IDC_STATIC,static,1342308352
+Control4=IDOK,button,1342373889
+
+[DLG:IDD_MOD_LOCAL_COM_PARAM (English (U.S.))]
+Type=1
+Class=CCommParameters
+ControlCount=36
+Control1=IDCANCEL,button,1342242816
+Control2=IDC_CBO_BAUD_RATE,combobox,1344339971
+Control3=IDC_STATIC,static,1342308352
+Control4=IDC_CBO_PARITY,combobox,1344340227
+Control5=IDC_STATIC,static,1342308352
+Control6=IDC_STATIC,static,1342308352
+Control7=IDC_STATIC,static,1342308352
+Control8=IDC_EDIT_TIME_OUT,edit,1350631552
+Control9=IDC_EDIT_CHAR_INTERVAL,edit,1350631552
+Control10=IDC_OK,button,1342242816
+Control11=IDC_CHK_ACTIVE,button,1342242819
+Control12=IDC_STATIC,static,1342177282
+Control13=IDC_CHK_DTRDSR,button,1342242819
+Control14=IDC_CHK_RTSCTS,button,1342177283
+Control15=IDC_CHK_XONXOFF,button,1342177283
+Control16=IDC_STATIC,static,1342177282
+Control17=IDC_CBO_STOPBITSCB,combobox,1344340483
+Control18=IDC_STATIC,button,1342177287
+Control19=IDC_RAD_RTU,button,1342177289
+Control20=IDC_RAD_ASCII,button,1342177289
+Control21=IDC_STATIC,static,1342177282
+Control22=IDC_CBO_BYTESIZE,combobox,1344340483
+Control23=IDC_EDIT_DCOM_SERVER,edit,1350631552
+Control24=IDC_STATIC,button,1342177287
+Control25=IDC_STATIC,static,1342308352
+Control26=IDC_CBO_COM_PORT,combobox,1344340227
+Control27=IDC_STATIC,static,1342308352
+Control28=IDC_STATIC,button,1342177287
+Control29=IDC_EDIT_IP_ADDR,edit,1350631552
+Control30=IDC_STATIC,static,1342308352
+Control31=IDC_STATIC,static,1342308352
+Control32=IDC_EDIT_PORT,edit,1350639744
+Control33=IDC_CHK_TCP_SERVER,button,1342242819
+Control34=IDC_BUTT_FIND_IP,button,1342242816
+Control35=IDC_STATIC,static,1342308352
+Control36=IDC_EDIT_DELAY,edit,1350631552
+
+[CLS:CCommParameters]
+Type=0
+HeaderFile=CommParameters.h
+ImplementationFile=CommParameters.cpp
+BaseClass=CDialog
+Filter=D
+VirtualFilter=dWC
+LastObject=CCommParameters
+
+[DLG:IDD_CONNECTIONS (English (U.S.))]
+Type=1
+Class=CDlgConnections
+ControlCount=8
+Control1=IDCANCEL,button,1342242816
+Control2=IDC_LST_CONNECTIOS,listbox,1352728835
+Control3=IDC_CMD_ADD,button,1342242816
+Control4=IDC_CMD_EDIT,button,1342242816
+Control5=IDC_CMD_REMOVE,button,1342242816
+Control6=IDC_CBO_TYPE,combobox,1344339971
+Control7=IDC_BUTTON_SAVE,button,1342242816
+Control8=IDC_BUTTON_LOAD,button,1342242816
+
+[CLS:CDlgConnections]
+Type=0
+HeaderFile=DlgConnections.h
+ImplementationFile=DlgConnections.cpp
+BaseClass=CDialog
+Filter=D
+LastObject=CDlgConnections
+VirtualFilter=dWC
+
+[DLG:IDD_MOD_REM_PARAMETERS]
+Type=1
+Class=CDlgRemoteParameters
+ControlCount=9
+Control1=IDOKey,button,1342242817
+Control2=IDCANCEL,button,1342242816
+Control3=IDC_STATIC,button,1342177287
+Control4=IDC_EDIT_IP_ADDR,edit,1350631552
+Control5=IDC_STATIC,static,1342308352
+Control6=IDC_STATIC,static,1342308352
+Control7=IDC_EDIT_PORT,edit,1350639744
+Control8=IDC_STATIC,static,1342308352
+Control9=IDC_EDIT_TIME_OUT,edit,1350631552
+
+[CLS:CDlgRemoteParameters]
+Type=0
+HeaderFile=DlgRemoteParameters.h
+ImplementationFile=DlgRemoteParameters.cpp
+BaseClass=CDialog
+Filter=D
+LastObject=IDOKey
+VirtualFilter=dWC
+
+[CLS:CSplashWnd]
+Type=0
+HeaderFile=Splash.h
+ImplementationFile=Splash.cpp
+BaseClass=CWnd
+LastObject=CSplashWnd
+
+[MNU:IDR_TRAY_ICON (English (U.S.))]
+Type=1
+Class=?
+Command1=ID_TRAY_MAIN
+Command2=ID_TRAY_CONNECTIONS
+Command3=ID_TRAY_EXIT
+Command4=ID_APP_ABOUT
+CommandCount=4
+
Index: trunk/Modbucfg.cpp
===================================================================
--- trunk/Modbucfg.cpp	(revision 10)
+++ trunk/Modbucfg.cpp	(revision 10)
@@ -0,0 +1,266 @@
+// Modbucfg.cpp : Defines the class behaviors for the application.
+//
+
+#include "stdafx.h"
+#include "Modbucfg.h"
+#include "OleFuncs.h"
+
+#include "MainFrm.h"
+#include "ChildFrm.h"
+#include "ModbucfgDoc.h"
+#include "ModbucfgView.h"
+#include "AutoModbus.h"
+#include "Splash.h"
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+CComModule _Module;
+
+/////////////////////////////////////////////////////////////////////////////
+// CModbucfgApp
+
+BEGIN_MESSAGE_MAP(CModbucfgApp, CWinApp)
+	//{{AFX_MSG_MAP(CModbucfgApp)
+	ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
+		// NOTE - the ClassWizard will add and remove mapping macros here.
+		//    DO NOT EDIT what you see in these blocks of generated code!
+	//}}AFX_MSG_MAP
+	// Standard file based document commands
+	ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
+	ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
+END_MESSAGE_MAP()
+
+/////////////////////////////////////////////////////////////////////////////
+// CModbucfgApp construction
+
+CModbucfgApp::CModbucfgApp()
+{
+	// TODO: add construction code here,
+	// Place all significant initialization in InitInstance
+}
+
+/////////////////////////////////////////////////////////////////////////////
+// The one and only CModbucfgApp object
+
+CModbucfgApp theApp;
+
+// This identifier was generated to be statistically unique for your app.
+// You may change it if you prefer to choose a specific identifier.
+
+// {A3BAD4A5-F5AE-11D1-8FE9-6CD504C1BC01}
+static const CLSID clsid =
+{ 0xa3bad4a5, 0xf5ae, 0x11d1, { 0x8f, 0xe9, 0x6c, 0xd5, 0x4, 0xc1, 0xbc, 0x1 } };
+
+/////////////////////////////////////////////////////////////////////////////
+// CModbucfgApp initialization
+
+BOOL CModbucfgApp::InitInstance()
+{
+
+	if (!DComOk()) {
+		AfxMessageBox(_T("DCOM OLE Not supported"),MB_SYSTEMMODAL+MB_OK);
+		return FALSE;       
+	}
+
+	if (!AfxSocketInit())
+	{
+		AfxMessageBox(IDP_SOCKETS_INIT_FAILED);
+		return FALSE;
+	}
+
+	// Initialize OLE libraries
+	if (!AfxOleInit2())
+	{
+		AfxMessageBox(IDP_OLE_INIT_FAILED);
+		return FALSE;
+	}
+
+	// Standard initialization
+	// If you are not using these features and wish to reduce the size
+	//  of your final executable, you should remove from the following
+	//  the specific initialization routines you do not need.
+
+#ifdef _AFXDLL
+	Enable3dControls();			// Call this when using MFC in a shared DLL
+#else
+	Enable3dControlsStatic();	// Call this when linking to MFC statically
+#endif
+
+	// Change the registry key under which our settings are stored.
+	// You should modify this string to be something appropriate
+	// such as the name of your company or organization.
+	//SetRegistryKey(_T("Local AppWizard-Generated Applications"));
+
+	
+	// Register the application's document templates.  Document templates
+	//  serve as the connection between documents, frame windows and views.
+
+	CMultiDocTemplate* pDocTemplate;
+	pDocTemplate = new CMultiDocTemplate(
+		IDR_MODBUCTYPE,
+		RUNTIME_CLASS(CModbucfgDoc),
+		RUNTIME_CLASS(CChildFrame), // custom MDI child frame
+		RUNTIME_CLASS(CModbucfgView));
+	AddDocTemplate(pDocTemplate);
+
+	// Parse command line for standard shell commands, DDE, file open
+	CCommandLineInfo cmdInfo;
+	ParseCommandLine(cmdInfo);
+
+	CSplashWnd::EnableSplashScreen(cmdInfo.m_bShowSplash);
+	
+	// create main MDI Frame window
+	CMainFrame* pMainFrame = new CMainFrame;
+	if (!pMainFrame->LoadFrame(IDR_MAINFRAME))
+		return FALSE;
+	m_pMainWnd = pMainFrame;
+
+	// DON'T display a new MDI child window during startup!!!
+    cmdInfo.m_nShellCommand = CCommandLineInfo::FileNothing;
+
+	// Dispatch commands specified on the command line
+	if (!ProcessShellCommand(cmdInfo))
+		return FALSE;
+
+	// The main window has been initialized, so show and update it.
+	pMainFrame->ShowWindow(m_nCmdShow);
+	pMainFrame->UpdateWindow();
+
+	return TRUE;
+}
+
+/////////////////////////////////////////////////////////////////////////////
+// CAboutDlg dialog used for App About
+
+class CAboutDlg : public CDialog
+{
+public:
+	CAboutDlg();
+
+// Dialog Data
+	//{{AFX_DATA(CAboutDlg)
+	enum { IDD = IDD_ABOUTBOX };
+	//}}AFX_DATA
+
+	// ClassWizard generated virtual function overrides
+	//{{AFX_VIRTUAL(CAboutDlg)
+	protected:
+	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
+	//}}AFX_VIRTUAL
+
+// Implementation
+protected:
+	//{{AFX_MSG(CAboutDlg)
+		// No message handlers
+	//}}AFX_MSG
+	DECLARE_MESSAGE_MAP()
+public:
+	afx_msg void OnBnClickedOk();
+};
+
+CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
+{
+	//{{AFX_DATA_INIT(CAboutDlg)
+	//}}AFX_DATA_INIT
+}
+
+void CAboutDlg::DoDataExchange(CDataExchange* pDX)
+{
+	CDialog::DoDataExchange(pDX);
+	//{{AFX_DATA_MAP(CAboutDlg)
+	//}}AFX_DATA_MAP
+}
+
+BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
+	//{{AFX_MSG_MAP(CAboutDlg)
+		// No message handlers
+	//}}AFX_MSG_MAP
+	ON_BN_CLICKED(IDOK, OnBnClickedOk)
+END_MESSAGE_MAP()
+
+// App command to run the dialog
+void CModbucfgApp::OnAppAbout()
+{
+	CAboutDlg aboutDlg;
+	aboutDlg.DoModal();
+}
+
+/////////////////////////////////////////////////////////////////////////////
+// CModbucfgApp commands
+
+void CModbucfgApp::Test()
+{
+	
+	CAutoModbus autoModbus;
+	
+	autoModbus.CreateInstance("","com3");
+	
+	autoModbus.ComPort(3);
+	autoModbus.BaudRate(1200);
+	autoModbus.Parity(mbNOPARITY);
+	autoModbus.Timeout(500);
+	autoModbus.TransmissionMode(mbMODE_RTU);
+	
+	
+	
+	autoModbus.m_pIModbusSrv->put_RaiseError(VARIANT_TRUE);
+	
+	if (!autoModbus.Connect()) {
+		return;
+		
+	}
+	
+	if (!autoModbus.LoopbackTest(1)){
+	}
+	
+	
+}
+
+
+BOOL CModbucfgApp::PreTranslateMessage(MSG* pMsg)
+{
+	// CG: The following lines were added by the Splash Screen component.
+	if (CSplashWnd::PreTranslateAppMessage(pMsg))
+		return TRUE;
+
+	return CWinApp::PreTranslateMessage(pMsg);
+}
+
+
+BOOL RegTypeLib(LPCSTR szTypeLibName) {
+
+	WCHAR* pwsz = new WCHAR[MAX_PATH];
+	BOOL bResp=FALSE;
+	HRESULT hRes;
+	ITypeLib* pITypeLib;
+	
+	::MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, szTypeLibName , -1,
+			pwsz, MAX_PATH);
+
+	hRes= ::LoadTypeLib((OLECHAR FAR*)pwsz,&pITypeLib);
+	
+	if FAILED(hRes){
+		bResp=FALSE;
+	}
+	else {
+		hRes = ::RegisterTypeLib((ITypeLib FAR*)pITypeLib,pwsz,NULL);   
+		bResp=(S_OK==hRes);
+		pITypeLib->Release();
+	}
+    
+	delete[]pwsz;
+	
+	return bResp;
+}
+
+
+
+void CAboutDlg::OnBnClickedOk()
+{
+	// TODO : ajoutez ici le code de votre gestionnaire de notification de contrôle
+	OnOK();
+}
Index: trunk/Modbucfg.dsp
===================================================================
--- trunk/Modbucfg.dsp	(revision 10)
+++ trunk/Modbucfg.dsp	(revision 10)
@@ -0,0 +1,256 @@
+# Microsoft Developer Studio Project File - Name="Modbucfg" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Application" 0x0101
+
+CFG=Modbucfg - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "Modbucfg.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "Modbucfg.mak" CFG="Modbucfg - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "Modbucfg - Win32 Release" (based on "Win32 (x86) Application")
+!MESSAGE "Modbucfg - Win32 Debug" (based on "Win32 (x86) Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "Modbucfg - Win32 Release"
+
+# PROP BASE Use_MFC 6
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 6
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\UtilClasses\Include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
+# ADD BASE RSC /l 0x416 /d "NDEBUG" /d "_AFXDLL"
+# ADD RSC /l 0x416 /d "NDEBUG" /d "_AFXDLL"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 /nologo /subsystem:windows /machine:I386
+# ADD LINK32 winmm.lib /nologo /subsystem:windows /machine:I386 /libpath:"..\ModbuLib"
+
+!ELSEIF  "$(CFG)" == "Modbucfg - Win32 Debug"
+
+# PROP BASE Use_MFC 6
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 6
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\UtilClasses\Include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+# ADD BASE RSC /l 0x416 /d "_DEBUG" /d "_AFXDLL"
+# ADD RSC /l 0x416 /d "_DEBUG" /d "_AFXDLL"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept /libpath:"..\ModbuLib"
+
+!ENDIF 
+
+# Begin Target
+
+# Name "Modbucfg - Win32 Release"
+# Name "Modbucfg - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\ChildFrm.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\CommParameters.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\Connection.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\Connections.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\DlgConnections.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\DlgRemoteParameters.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\Globals.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\MainFrm.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\Modbucfg.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\Modbucfg.rc
+# End Source File
+# Begin Source File
+
+SOURCE=.\ModbucfgDoc.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\ModbucfgView.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\Splash.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\StdAfx.cpp
+# ADD CPP /Yc"stdafx.h"
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=.\ChildFrm.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\CommParameters.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\Connection.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\Connections.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\DlgConnections.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\DlgRemoteParameters.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\Globals.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\MainFrm.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\Modbucfg.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\ModbucfgDoc.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\ModbucfgView.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\Resource.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\Splash.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\StdAfx.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe"
+# Begin Source File
+
+SOURCE=.\res\idr_tray.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\res\Modbucfg.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\res\Modbucfg.rc2
+# End Source File
+# Begin Source File
+
+SOURCE=.\res\ModbucfgDoc.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\Splsh16.bmp
+# End Source File
+# Begin Source File
+
+SOURCE=.\res\Toolbar.bmp
+# End Source File
+# End Group
+# Begin Source File
+
+SOURCE=.\Modbucfg.reg
+# End Source File
+# Begin Source File
+
+SOURCE=.\Modifications.txt
+# End Source File
+# Begin Source File
+
+SOURCE=.\ReadMe.txt
+# End Source File
+# End Target
+# End Project
+# Section Modbucfg : {00000000-0000-0000-0000-000000000000}
+# 	1:10:IDB_SPLASH:102
+# 	2:21:SplashScreenInsertKey:4.0
+# End Section
Index: trunk/Modbucfg.dsw
===================================================================
--- trunk/Modbucfg.dsw	(revision 10)
+++ trunk/Modbucfg.dsw	(revision 10)
@@ -0,0 +1,53 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "ModbuLib"=..\ModbuLib\ModbuLib.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "Modbucfg"=.\Modbucfg.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "ModbusServer"=..\ModbusServer\ModbusServer.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
Index: trunk/Modbucfg.h
===================================================================
--- trunk/Modbucfg.h	(revision 10)
+++ trunk/Modbucfg.h	(revision 10)
@@ -0,0 +1,55 @@
+// Modbucfg.h : main header file for the MODBUCFG application
+//
+
+#if !defined(AFX_MODBUCFG_H__A3BAD4AA_F5AE_11D1_8FE9_6CD504C1BC01__INCLUDED_)
+#define AFX_MODBUCFG_H__A3BAD4AA_F5AE_11D1_8FE9_6CD504C1BC01__INCLUDED_
+
+#if _MSC_VER >= 1000
+#pragma once
+#endif // _MSC_VER >= 1000
+
+#ifndef __AFXWIN_H__
+	#error include 'stdafx.h' before including this file for PCH
+#endif
+
+#include "resource.h"       // main symbols
+
+/////////////////////////////////////////////////////////////////////////////
+// CModbucfgApp:
+// See Modbucfg.cpp for the implementation of this class
+//
+
+class CModbucfgApp : public CWinApp
+{
+public:
+	virtual BOOL PreTranslateMessage(MSG* pMsg);
+	void Test();
+	CModbucfgApp();
+
+// Overrides
+	// ClassWizard generated virtual function overrides
+	//{{AFX_VIRTUAL(CModbucfgApp)
+	public:
+	virtual BOOL InitInstance();
+	//}}AFX_VIRTUAL
+
+// Implementation
+	//COleTemplateServer m_server;
+		// Server object for document creation
+
+	//{{AFX_MSG(CModbucfgApp)
+	afx_msg void OnAppAbout();
+		// NOTE - the ClassWizard will add and remove member functions here.
+		//    DO NOT EDIT what you see in these blocks of generated code !
+	//}}AFX_MSG
+	DECLARE_MESSAGE_MAP()
+};
+
+BOOL RegTypeLib(LPCSTR szTypeLibName);
+
+/////////////////////////////////////////////////////////////////////////////
+
+//{{AFX_INSERT_LOCATION}}
+// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
+
+#endif // !defined(AFX_MODBUCFG_H__A3BAD4AA_F5AE_11D1_8FE9_6CD504C1BC01__INCLUDED_)
Index: trunk/Modbucfg.odl
===================================================================
--- trunk/Modbucfg.odl	(revision 10)
+++ trunk/Modbucfg.odl	(revision 10)
@@ -0,0 +1,42 @@
+// Modbucfg.odl : type library source for Modbucfg.exe
+
+// This file will be processed by the MIDL compiler to produce the
+// type library (Modbucfg.tlb).
+/*
+[ uuid(A3BAD4A6-F5AE-11D1-8FE9-6CD504C1BC01), version(1.0) ]
+library Modbucfg
+{
+	importlib("stdole32.tlb");
+	
+
+	//  Primary dispatch interface for CModbucfgDoc
+	
+	[ uuid(A3BAD4A7-F5AE-11D1-8FE9-6CD504C1BC01) ]
+	dispinterface IModbucfg
+	{
+		properties:
+			// NOTE - ClassWizard will maintain property information here.
+			//    Use extreme caution when editing this section.
+			//{{AFX_ODL_PROP(CModbucfgDoc)
+			//}}AFX_ODL_PROP
+			
+		methods:
+			// NOTE - ClassWizard will maintain method information here.
+			//    Use extreme caution when editing this section.
+			//{{AFX_ODL_METHOD(CModbucfgDoc)
+			//}}AFX_ODL_METHOD
+
+	};
+
+	//  Class information for CModbucfgDoc
+	
+	[ uuid(A3BAD4A5-F5AE-11D1-8FE9-6CD504C1BC01) ]
+	coclass Document
+	{
+		[default] dispinterface IModbucfg;
+	};
+
+	//{{AFX_APPEND_ODL}}
+	//}}AFX_APPEND_ODL}}
+};
+*
Index: trunk/Modbucfg.plg
===================================================================
--- trunk/Modbucfg.plg	(revision 10)
+++ trunk/Modbucfg.plg	(revision 10)
@@ -0,0 +1,78 @@
+<html>
+<body>
+<pre>
+<h1>Build Log</h1>
+<h3>
+--------------------Configuration: Modbucfg - Win32 Release--------------------
+</h3>
+<h3>Command Lines</h3>
+Creating command line "rc.exe /l 0x416 /fo"Release/Modbucfg.res" /d "NDEBUG" /d "_AFXDLL" "D:\Vcprojs98\Modbucfg\Modbucfg.rc"" 
+Creating temporary file "D:\TEMP\RSP4A.tmp" with contents
+[
+/nologo /MD /W3 /GX /O2 /I "..\UtilClasses\Include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /Fp"Release/Modbucfg.pch" /Yu"stdafx.h" /Fo"Release/" /Fd"Release/" /FD /c 
+"D:\Vcprojs98\Modbucfg\ChildFrm.cpp"
+"D:\Vcprojs98\Modbucfg\CommParameters.cpp"
+"D:\Vcprojs98\Modbucfg\Connection.cpp"
+"D:\Vcprojs98\Modbucfg\Connections.cpp"
+"D:\Vcprojs98\Modbucfg\DlgConnections.cpp"
+"D:\Vcprojs98\Modbucfg\DlgRemoteParameters.cpp"
+"D:\Vcprojs98\Modbucfg\Globals.cpp"
+"D:\Vcprojs98\Modbucfg\MainFrm.cpp"
+"D:\Vcprojs98\Modbucfg\Modbucfg.cpp"
+"D:\Vcprojs98\Modbucfg\ModbucfgDoc.cpp"
+"D:\Vcprojs98\Modbucfg\ModbucfgView.cpp"
+"D:\Vcprojs98\Modbucfg\Splash.cpp"
+]
+Creating command line "cl.exe @D:\TEMP\RSP4A.tmp" 
+Creating temporary file "D:\TEMP\RSP4B.tmp" with contents
+[
+/nologo /MD /W3 /GX /O2 /I "..\UtilClasses\Include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /Fp"Release/Modbucfg.pch" /Yc"stdafx.h" /Fo"Release/" /Fd"Release/" /FD /c 
+"D:\Vcprojs98\Modbucfg\StdAfx.cpp"
+]
+Creating command line "cl.exe @D:\TEMP\RSP4B.tmp" 
+Creating temporary file "D:\TEMP\RSP4C.tmp" with contents
+[
+winmm.lib /nologo /subsystem:windows /incremental:no /pdb:"Release/Modbucfg.pdb" /machine:I386 /out:"Release/Modbucfg.exe" /libpath:"..\ModbuLib" 
+.\Release\ChildFrm.obj
+.\Release\CommParameters.obj
+.\Release\Connection.obj
+.\Release\Connections.obj
+.\Release\DlgConnections.obj
+.\Release\DlgRemoteParameters.obj
+.\Release\Globals.obj
+.\Release\MainFrm.obj
+.\Release\Modbucfg.obj
+.\Release\ModbucfgDoc.obj
+.\Release\ModbucfgView.obj
+.\Release\Splash.obj
+.\Release\StdAfx.obj
+.\Release\Modbucfg.res
+]
+Creating command line "link.exe @D:\TEMP\RSP4C.tmp"
+<h3>Output Window</h3>
+Compiling resources...
+Compiling...
+StdAfx.cpp
+Compiling...
+ChildFrm.cpp
+CommParameters.cpp
+Connection.cpp
+Connections.cpp
+DlgConnections.cpp
+DlgRemoteParameters.cpp
+Globals.cpp
+MainFrm.cpp
+Modbucfg.cpp
+ModbucfgDoc.cpp
+ModbucfgView.cpp
+Splash.cpp
+Generating Code...
+Linking...
+
+
+
+<h3>Results</h3>
+Modbucfg.exe - 0 error(s), 0 warning(s)
+</pre>
+</body>
+</html>
Index: trunk/Modbucfg.rc
===================================================================
--- trunk/Modbucfg.rc	(revision 10)
+++ trunk/Modbucfg.rc	(revision 10)
@@ -0,0 +1,788 @@
+// Microsoft Visual C++ generated resource script.
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "afxres.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// Anglais (États-Unis) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
+#ifdef _WIN32
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+#pragma code_page(1252)
+#endif //_WIN32
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Icon
+//
+
+// Icon with lowest ID value placed first to ensure application icon
+// remains consistent on all systems.
+IDR_MAINFRAME           ICON                    "res\\Modbucfg.ico"
+IDR_MODBUCTYPE          ICON                    "res\\ModbucfgDoc.ico"
+IDR_TRAY_ICON           ICON                    "res\\idr_tray.ico"
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Bitmap
+//
+
+IDR_MAINFRAME           BITMAP                  "res\\Toolbar.bmp"
+IDB_SPLASH              BITMAP                  "Splsh16.bmp"
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Toolbar
+//
+
+IDR_MAINFRAME TOOLBAR  16, 15
+BEGIN
+    BUTTON      ID_FILE_NEW
+    BUTTON      ID_FILE_OPEN
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Menu
+//
+
+IDR_MAINFRAME MENU 
+BEGIN
+    POPUP "&File"
+    BEGIN
+        MENUITEM "&New\tCtrl+N",                ID_FILE_NEW
+        MENUITEM SEPARATOR
+        MENUITEM "E&xit",                       ID_APP_EXIT
+    END
+    POPUP "&View"
+    BEGIN
+        MENUITEM "&Toolbar",                    ID_VIEW_TOOLBAR
+        MENUITEM "&Status Bar",                 ID_VIEW_STATUS_BAR
+    END
+    POPUP "&Options"
+    BEGIN
+        MENUITEM "&Connections...",             ID_OPTIONS_CONNECTIONS
+        MENUITEM "&Register Type Library...",   ID_OPTIONS_REGISTERTYPELIBRARY
+
+    END
+    POPUP "&Help"
+    BEGIN
+        MENUITEM "&About Modbucfg...",          ID_APP_ABOUT
+    END
+END
+
+IDR_MODBUCTYPE MENU 
+BEGIN
+    POPUP "&File"
+    BEGIN
+        MENUITEM "&New\tCtrl+N",                ID_FILE_NEW
+        MENUITEM "&Close",                      ID_FILE_CLOSE
+        MENUITEM SEPARATOR
+        MENUITEM "E&xit",                       ID_APP_EXIT
+    END
+    POPUP "&View"
+    BEGIN
+        MENUITEM "&Toolbar",                    ID_VIEW_TOOLBAR
+        MENUITEM "&Status Bar",                 ID_VIEW_STATUS_BAR
+    END
+    POPUP "&Window"
+    BEGIN
+        MENUITEM "&New Window",                 ID_WINDOW_NEW
+        MENUITEM "&Cascade",                    ID_WINDOW_CASCADE
+        MENUITEM "&Tile",                       ID_WINDOW_TILE_HORZ
+        MENUITEM "&Arrange Icons",              ID_WINDOW_ARRANGE
+    END
+    POPUP "&Help"
+    BEGIN
+        MENUITEM "&About Modbucfg...",          ID_APP_ABOUT
+        MENUITEM "About &Mem Map",              ID_APP_MEM_MAP
+    END
+END
+
+IDR_TRAY_ICON MENU 
+BEGIN
+    POPUP "Tray"
+    BEGIN
+        MENUITEM "Poll Device",                 ID_TRAY_MAIN
+        MENUITEM "&Connections...",             ID_TRAY_CONNECTIONS
+        MENUITEM "&Terminate",                  ID_TRAY_EXIT
+        MENUITEM SEPARATOR
+        MENUITEM "&About",                      ID_APP_ABOUT
+    END
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Accelerator
+//
+
+IDR_MAINFRAME ACCELERATORS 
+BEGIN
+    "N",            ID_FILE_NEW,            VIRTKEY, CONTROL
+    "O",            ID_FILE_OPEN,           VIRTKEY, CONTROL
+    "S",            ID_FILE_SAVE,           VIRTKEY, CONTROL
+    "Z",            ID_EDIT_UNDO,           VIRTKEY, CONTROL
+    "X",            ID_EDIT_CUT,            VIRTKEY, CONTROL
+    "C",            ID_EDIT_COPY,           VIRTKEY, CONTROL
+    "V",            ID_EDIT_PASTE,          VIRTKEY, CONTROL
+    VK_BACK,        ID_EDIT_UNDO,           VIRTKEY, ALT
+    VK_DELETE,      ID_EDIT_CUT,            VIRTKEY, SHIFT
+    VK_INSERT,      ID_EDIT_COPY,           VIRTKEY, CONTROL
+    VK_INSERT,      ID_EDIT_PASTE,          VIRTKEY, SHIFT
+    VK_F6,          ID_NEXT_PANE,           VIRTKEY 
+    VK_F6,          ID_PREV_PANE,           VIRTKEY, SHIFT
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog
+//
+
+IDD_ABOUTBOX DIALOGEX 0, 0, 230, 102
+STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "About Client Simul"
+FONT 8, "MS Sans Serif", 0, 0, 0x0
+BEGIN
+    ICON            IDR_MAINFRAME,IDC_STATIC,11,17,21,20
+    LTEXT           "from Modbucfg Version 1.0",IDC_STATIC,40,40,119,8,
+                    SS_NOPREFIX
+    LTEXT           "Copyright (C) 1998",IDC_STATIC,40,52,119,8
+    DEFPUSHBUTTON   "OK",IDOK,191,7,32,14,WS_GROUP
+    LTEXT           "    Xfel Client Simulator v1.0",IDC_STATIC,40,20,119,8,
+                    SS_NOPREFIX
+END
+
+IDD_MODBUCFG_FORM DIALOGEX 0, 0, 630, 467
+STYLE DS_SETFONT | DS_CONTROL | WS_CHILD
+FONT 8, "MS Sans Serif", 0, 0, 0x1
+BEGIN
+    GROUPBOX        "",IDC_STATIC,7,11,175,29
+    COMBOBOX        IDC_CBO_READ_FUNCTION,13,50,89,55,CBS_DROPDOWNLIST | 
+                    WS_VSCROLL | WS_TABSTOP
+    LTEXT           "Device:",IDC_STATIC,11,19,26,10
+    EDITTEXT        IDC_EDIT_DEVICE,38,18,18,12,ES_AUTOHSCROLL | ES_NUMBER
+    LTEXT           "Address:",IDC_STATIC,13,68,28,10
+    EDITTEXT        IDC_EDIT_ADDR,44,66,52,12,ES_AUTOHSCROLL | ES_NUMBER
+    LTEXT           "Quantity:",IDC_STATIC,106,67,29,10
+    EDITTEXT        IDC_EDIT_QUANT,138,66,27,12,ES_AUTOHSCROLL | ES_NUMBER
+    GROUPBOX        "Polling",IDC_STATIC,13,163,89,48,WS_GROUP
+    CONTROL         "Enable",IDC_CHK_Enable_Poll,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,21,175,36,11
+    CONTROL         "",IDC_STAT_STATUS,"Static",SS_LEFTNOWORDWRAP | 
+                    WS_BORDER | WS_GROUP,232,14,174,15,WS_EX_STATICEDGE
+    LTEXT           "Value:",IDC_STATIC,114,119,21,9
+    EDITTEXT        IDC_EDIT_VALUE,137,116,39,12,ES_AUTOHSCROLL
+    PUSHBUTTON      "Write",IDC_CMD_WRITE,182,116,32,10
+    COMBOBOX        IDC_CBO_WRITE_FUNCTION,18,100,89,55,CBS_DROPDOWNLIST | 
+                    WS_VSCROLL | WS_TABSTOP
+    CONTROL         "",IDC_STAT_ERROR,"Static",SS_LEFTNOWORDWRAP | WS_BORDER | 
+                    WS_GROUP,231,159,174,15,WS_EX_STATICEDGE
+    LTEXT           "Address:",IDC_STATIC,13,118,28,10
+    EDITTEXT        IDC_EDIT_ADDR_WRI,44,116,52,12,ES_AUTOHSCROLL | 
+                    ES_NUMBER
+    LISTBOX         IDC_LST_VALUES,232,31,174,105,LBS_SORT | 
+                    LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP,
+                    WS_EX_STATICEDGE
+    GROUPBOX        "Read Function ",IDC_FRA_MOD_FUNCTIONS2,7,39,210,48
+    COMBOBOX        IDC_CBO_CONNECTION,67,18,89,55,CBS_DROPDOWNLIST | 
+                    WS_VSCROLL | WS_TABSTOP
+    LTEXT           "Interval(ms):",IDC_STATIC,21,191,41,9
+    EDITTEXT        IDC_EDIT_INTERVAL,60,190,39,12,ES_AUTOHSCROLL
+    LTEXT           "Data Type ",IDC_STATIC,232,144,37,10
+    COMBOBOX        IDC_CBO_DATA_TYPE,271,141,133,46,CBS_DROPDOWNLIST | 
+                    WS_VSCROLL | WS_TABSTOP
+    EDITTEXT        IDC_EDIT_QUANT_2,136,131,40,14,ES_AUTOHSCROLL | 
+                    ES_NUMBER
+    LTEXT           "Quantity:",IDC_STATIC,106,132,29,8
+    EDITTEXT        IDC_EDIT6,137,100,17,13,ES_MULTILINE | ES_AUTOHSCROLL | 
+                    ES_READONLY | ES_WANTRETURN
+    CONTROL         "",IDC_SPIN2,"msctls_updown32",UDS_SETBUDDYINT | 
+                    UDS_AUTOBUDDY | UDS_ARROWKEYS,155,96,7,19
+    LTEXT           "Index:",IDC_STATIC,115,101,21,9
+    EDITTEXT        IDC_EDIT3,57,234,20,12,ES_AUTOHSCROLL
+    LTEXT           "Eil",IDC_STATIC,47,236,8,8
+    GROUPBOX        "Vacuum level (mbar)",IDC_STATIC,544,241,78,74
+    EDITTEXT        IDC_EDIT5,567,253,40,14,ES_AUTOHSCROLL
+    EDITTEXT        IDC_EDIT7,567,268,40,14,ES_AUTOHSCROLL
+    EDITTEXT        IDC_EDIT8,567,281,40,14,ES_AUTOHSCROLL
+    EDITTEXT        IDC_EDIT9,567,296,40,14,ES_AUTOHSCROLL
+    LTEXT           "SVd",IDC_STATIC,549,256,14,8
+    LTEXT           "SVfin",IDC_STATIC,547,270,18,8
+    LTEXT           "SV1",IDC_STATIC,549,285,14,8
+    LTEXT           "SV2",IDC_STATIC,549,298,14,8
+    GROUPBOX        "Power level/wait",IDC_STATIC,441,241,90,74
+    EDITTEXT        IDC_EDIT10,486,253,40,14,ES_AUTOHSCROLL
+    EDITTEXT        IDC_EDIT11,487,268,40,14,ES_AUTOHSCROLL
+    EDITTEXT        IDC_EDIT12,487,282,40,14,ES_AUTOHSCROLL
+    EDITTEXT        IDC_EDIT13,487,296,40,14,ES_AUTOHSCROLL
+    LTEXT           "dtp(min)",IDC_STATIC,458,256,26,8
+    LTEXT           "dt(sec)",IDC_STATIC,462,270,22,8
+    LTEXT           "dP(dB)",IDC_STATIC,462,285,22,8
+    LTEXT           "dPsecu(dB)",IDC_STATIC,448,298,38,8
+    GROUPBOX        "xxx",IDC_STATIC,444,370,165,56
+    EDITTEXT        IDC_EDIT14,566,377,40,14,ES_AUTOHSCROLL
+    EDITTEXT        IDC_EDIT15,566,392,40,14,ES_AUTOHSCROLL
+    EDITTEXT        IDC_EDIT16,566,406,40,14,ES_AUTOHSCROLL
+    EDITTEXT        IDC_EDIT17,488,377,40,14,ES_AUTOHSCROLL
+    EDITTEXT        IDC_EDIT18,488,392,40,14,ES_AUTOHSCROLL
+    EDITTEXT        IDC_EDIT19,489,406,40,14,ES_AUTOHSCROLL
+    LTEXT           "SVil(mbar)",IDC_STATIC,533,380,32,8
+    LTEXT           "Sleil(mA)",IDC_STATIC,537,395,28,8
+    LTEXT           "STc(°C)",IDC_STATIC,539,407,26,8
+    LTEXT           "Nbal_max",IDC_STATIC,452,379,32,8
+    LTEXT           "Fr(Hz)",IDC_STATIC,466,394,19,8
+    LTEXT           "N_cur",IDC_STATIC,464,407,20,8
+    PUSHBUTTON      "Read",IDC_CMD_READ,181,61,31,11
+    GROUPBOX        "interlock",IDC_STATIC,15,227,83,90
+    EDITTEXT        IDC_EDIT4,57,249,32,12,ES_AUTOHSCROLL
+    EDITTEXT        IDC_EDIT20,57,263,32,12,ES_AUTOHSCROLL
+    EDITTEXT        IDC_EDIT21,57,276,32,12,ES_AUTOHSCROLL
+    EDITTEXT        IDC_EDIT22,57,289,32,12,ES_AUTOHSCROLL
+    EDITTEXT        IDC_EDIT23,57,301,32,12,ES_AUTOHSCROLL
+    LTEXT           "Nil",IDC_STATIC,46,251,9,8
+    LTEXT           "Nil_stat",IDC_STATIC,32,265,24,8
+    LTEXT           "P_last(dBm)",IDC_STATIC,18,278,38,8
+    LTEXT           "N_last",IDC_STATIC,34,290,21,8
+    LTEXT           "dPil(dB)",IDC_STATIC,32,302,25,8
+    GROUPBOX        "yyy",IDC_STATIC,444,315,165,58
+    EDITTEXT        IDC_EDIT24,572,325,32,12,ES_AUTOHSCROLL
+    EDITTEXT        IDC_EDIT25,572,338,32,12,ES_AUTOHSCROLL
+    EDITTEXT        IDC_EDIT26,572,352,32,12,ES_AUTOHSCROLL
+    EDITTEXT        IDC_EDIT27,495,328,32,12,ES_AUTOHSCROLL
+    EDITTEXT        IDC_EDIT28,495,340,32,12,ES_AUTOHSCROLL
+    EDITTEXT        IDC_EDIT29,495,352,32,12,ES_AUTOHSCROLL
+    LTEXT           "V_cur(mbar)",IDC_STATIC,532,328,39,8
+    LTEXT           "Pic(kW)",IDC_STATIC,545,341,23,8
+    LTEXT           "Timer",IDC_STATIC,549,354,17,8
+    LTEXT           "Nbal",IDC_STATIC,475,329,18,8
+    LTEXT           "P_cde(dBm)",IDC_STATIC,454,340,40,8
+    LTEXT           "Pp(kW)",IDC_STATIC,469,352,26,8
+    GROUPBOX        "conditioning",IDC_STATIC,16,328,423,98
+    EDITTEXT        IDC_EDIT30,62,367,20,12,ES_AUTOHSCROLL
+    EDITTEXT        IDC_EDIT31,94,367,20,12,ES_AUTOHSCROLL
+    EDITTEXT        IDC_EDIT32,125,367,20,12,ES_AUTOHSCROLL
+    EDITTEXT        IDC_EDIT33,156,367,19,12,ES_AUTOHSCROLL
+    EDITTEXT        IDC_EDIT34,186,367,20,12,ES_AUTOHSCROLL
+    EDITTEXT        IDC_EDIT35,218,367,18,12,ES_AUTOHSCROLL
+    EDITTEXT        IDC_EDIT36,248,367,19,12,ES_AUTOHSCROLL
+    EDITTEXT        IDC_EDIT37,279,367,19,12,ES_AUTOHSCROLL
+    EDITTEXT        IDC_EDIT38,161,345,32,12,ES_AUTOHSCROLL
+    EDITTEXT        IDC_EDIT39,193,345,32,12,ES_AUTOHSCROLL
+    EDITTEXT        IDC_EDIT40,231,345,32,12,ES_AUTOHSCROLL
+    EDITTEXT        IDC_EDIT41,262,345,32,12,ES_AUTOHSCROLL
+    EDITTEXT        IDC_EDIT42,299,345,32,12,ES_AUTOHSCROLL
+    EDITTEXT        IDC_EDIT43,331,345,32,12,ES_AUTOHSCROLL
+    EDITTEXT        IDC_EDIT44,368,345,32,12,ES_AUTOHSCROLL
+    EDITTEXT        IDC_EDIT45,398,345,32,12,ES_AUTOHSCROLL
+    EDITTEXT        IDC_EDIT46,57,383,32,12,ES_AUTOHSCROLL
+    EDITTEXT        IDC_EDIT47,88,383,32,12,ES_AUTOHSCROLL
+    EDITTEXT        IDC_EDIT48,120,383,32,12,ES_AUTOHSCROLL
+    EDITTEXT        IDC_EDIT49,150,383,32,12,ES_AUTOHSCROLL
+    EDITTEXT        IDC_EDIT50,182,383,32,12,ES_AUTOHSCROLL
+    EDITTEXT        IDC_EDIT51,212,383,32,12,ES_AUTOHSCROLL
+    EDITTEXT        IDC_EDIT52,243,383,32,12,ES_AUTOHSCROLL
+    EDITTEXT        IDC_EDIT53,274,383,32,12,ES_AUTOHSCROLL
+    EDITTEXT        IDC_EDIT54,138,411,32,12,ES_AUTOHSCROLL
+    EDITTEXT        IDC_EDIT55,321,411,32,12,ES_AUTOHSCROLL
+    EDITTEXT        IDC_EDIT56,281,411,32,12,ES_AUTOHSCROLL
+    LTEXT           "N_Seqcond",IDC_STATIC,134,401,39,8
+    LTEXT           "DateD",IDC_STATIC,288,401,22,8
+    LTEXT           "HeureD",IDC_STATIC,324,401,26,8
+    LTEXT           "Num_C",IDC_STATIC,132,345,24,8
+    LTEXT           "Stat_C",IDC_STATIC,33,369,22,8
+    LTEXT           "Temp_cond",IDC_STATIC,18,384,39,8
+    EDITTEXT        IDC_EDIT57,205,411,32,12,ES_AUTOHSCROLL
+    LTEXT           "status",IDC_STATIC,210,401,20,8
+    LTEXT           "1a",IDC_STATIC,170,335,9,8
+    LTEXT           "2a",IDC_STATIC,242,335,8,8
+    LTEXT           "3a",IDC_STATIC,308,335,8,8
+    LTEXT           "4a",IDC_STATIC,375,335,8,8
+    LTEXT           "1",IDC_STATIC,70,359,8,8
+    LTEXT           "2",IDC_STATIC,101,359,8,8
+    LTEXT           "3",IDC_STATIC,132,359,8,8
+    LTEXT           "4",IDC_STATIC,162,359,8,8
+    LTEXT           "5",IDC_STATIC,194,359,8,8
+    LTEXT           "6",IDC_STATIC,223,359,8,8
+    LTEXT           "7",IDC_STATIC,255,359,8,8
+    LTEXT           "8",IDC_STATIC,286,359,8,8
+    LTEXT           "1b",IDC_STATIC,201,335,9,8
+    LTEXT           "2b",IDC_STATIC,271,335,8,8
+    LTEXT           "3b",IDC_STATIC,337,335,8,8
+    LTEXT           "4b",IDC_STATIC,407,335,8,8
+    GROUPBOX        "Write Function",IDC_FRA_MOD_WRITE_FUNCTIONS,7,86,210,67
+    CONTROL         "",IDC_LIST2,"SysListView32",LVS_REPORT | LVS_ALIGNLEFT | 
+                    LVS_NOSCROLL | WS_BORDER | WS_TABSTOP,334,200,99,116
+    LTEXT           "vacuum",IDC_STATIC,372,187,26,8
+    CONTROL         "",IDC_STATIC,"Static",SS_BLACKFRAME,322,214,11,23
+    LTEXT           "a",IDC_STATIC,326,223,8,8
+    CONTROL         "",IDC_STATIC,"Static",SS_BLACKFRAME,322,240,11,23
+    CONTROL         "",IDC_STATIC,"Static",SS_BLACKFRAME,322,265,11,23
+    CONTROL         "",IDC_STATIC,"Static",SS_BLACKFRAME,322,290,11,23
+    LTEXT           "b",IDC_STATIC,325,247,8,8
+    LTEXT           "c",IDC_STATIC,325,272,8,8
+    LTEXT           "d",IDC_STATIC,325,296,8,8
+    CONTROL         "",IDC_LIST3,"SysListView32",LVS_REPORT | LVS_ALIGNLEFT | 
+                    LVS_NOSCROLL | WS_BORDER | WS_TABSTOP,112,200,198,116
+    LTEXT           "parameters",IDC_STATIC,188,187,36,8
+    EDITTEXT        IDC_EDIT58,310,367,19,12,ES_AUTOHSCROLL
+    EDITTEXT        IDC_EDIT59,344,367,19,12,ES_AUTOHSCROLL
+    EDITTEXT        IDC_EDIT60,377,367,19,12,ES_AUTOHSCROLL
+    EDITTEXT        IDC_EDIT61,408,367,19,12,ES_AUTOHSCROLL
+    EDITTEXT        IDC_EDIT62,305,383,32,12,ES_AUTOHSCROLL
+    EDITTEXT        IDC_EDIT63,337,383,32,12,ES_AUTOHSCROLL
+    EDITTEXT        IDC_EDIT64,371,383,32,12,ES_AUTOHSCROLL
+    EDITTEXT        IDC_EDIT65,403,383,32,12,ES_AUTOHSCROLL
+    LTEXT           "9",IDC_STATIC,317,359,8,8
+    LTEXT           "10",IDC_STATIC,351,359,8,8
+    LTEXT           "11",IDC_STATIC,382,359,8,8
+    LTEXT           "12",IDC_STATIC,413,359,8,8
+    PUSHBUTTON      "Open config file",IDC_BUTTON1,519,91,52,18
+    PUSHBUTTON      "Send config",IDC_BUTTON2,520,112,50,17
+END
+
+IDD_MOD_LOCAL_COM_PARAM DIALOG  0, 0, 269, 190
+STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Communications Parameters"
+FONT 8, "MS Sans Serif"
+BEGIN
+    PUSHBUTTON      "Cancel",IDCANCEL,201,154,39,13
+    COMBOBOX        IDC_CBO_BAUD_RATE,119,15,54,48,CBS_DROPDOWNLIST | 
+                    WS_VSCROLL | WS_TABSTOP
+    LTEXT           "Baudrate",IDC_STATIC,85,16,31,10
+    COMBOBOX        IDC_CBO_PARITY,34,30,65,48,CBS_DROPDOWNLIST | CBS_SORT | 
+                    WS_VSCROLL | WS_TABSTOP
+    LTEXT           "Parity",IDC_STATIC,14,34,20,9
+    LTEXT           "Time-out (ms)",IDC_STATIC,13,50,44,10
+    LTEXT           "Silent Interval (ms)",IDC_STATIC,197,49,57,10
+    EDITTEXT        IDC_EDIT_TIME_OUT,13,60,46,12,ES_AUTOHSCROLL
+    EDITTEXT        IDC_EDIT_CHAR_INTERVAL,197,60,51,12,ES_AUTOHSCROLL
+    PUSHBUTTON      "&Ok",IDC_OK,153,154,39,12
+    CONTROL         "&Active",IDC_CHK_ACTIVE,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,119,33,37,10
+    RTEXT           "F&low:",IDC_STATIC,13,75,17,10,NOT WS_GROUP
+    CONTROL         "DTR/DSR",IDC_CHK_DTRDSR,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,33,75,50,10
+    CONTROL         "RTS/CTS",IDC_CHK_RTSCTS,"Button",BS_AUTOCHECKBOX,33,85,
+                    50,10
+    CONTROL         "XON/XOFF",IDC_CHK_XONXOFF,"Button",BS_AUTOCHECKBOX,33,
+                    95,50,10
+    RTEXT           "&Stop Bits:",IDC_STATIC,173,17,40,10,NOT WS_GROUP
+    COMBOBOX        IDC_CBO_STOPBITSCB,218,15,32,35,CBS_DROPDOWNLIST | 
+                    CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
+    GROUPBOX        "Transmission Mode",IDC_STATIC,128,78,121,28
+    CONTROL         "RTU",IDC_RAD_RTU,"Button",BS_AUTORADIOBUTTON,145,91,38,
+                    11
+    CONTROL         "ASCII",IDC_RAD_ASCII,"Button",BS_AUTORADIOBUTTON,201,91,
+                    38,11
+    RTEXT           "Byte Size:",IDC_STATIC,179,34,32,10,NOT WS_GROUP
+    COMBOBOX        IDC_CBO_BYTESIZE,217,33,32,35,CBS_DROPDOWNLIST | 
+                    CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
+    EDITTEXT        IDC_EDIT_DCOM_SERVER,40,115,205,12,ES_AUTOHSCROLL
+    GROUPBOX        "DCOM",IDC_STATIC,7,106,242,26
+    LTEXT           "Server",IDC_STATIC,13,118,23,10
+    COMBOBOX        IDC_CBO_COM_PORT,32,15,41,48,CBS_DROPDOWNLIST | CBS_SORT | 
+                    WS_VSCROLL | WS_TABSTOP
+    LTEXT           "Port",IDC_STATIC,13,16,15,9
+    GROUPBOX        "Server",IDC_STATIC,7,135,142,50
+    EDITTEXT        IDC_EDIT_IP_ADDR,13,153,76,12,ES_AUTOHSCROLL
+    LTEXT           "IP Address",IDC_STATIC,13,143,49,9
+    LTEXT           "Port",IDC_STATIC,94,143,37,8
+    EDITTEXT        IDC_EDIT_PORT,93,153,42,12,ES_AUTOHSCROLL | ES_NUMBER
+    CONTROL         "Enable TCP Server",IDC_CHK_TCP_SERVER,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,13,164,75,15
+    PUSHBUTTON      "&Find IP",IDC_BUTT_FIND_IP,93,169,41,10
+    LTEXT           "Error Delay (ms)",IDC_STATIC,105,49,53,10
+    EDITTEXT        IDC_EDIT_DELAY,105,60,46,12,ES_AUTOHSCROLL
+END
+
+IDD_CONNECTIONS DIALOG  0, 0, 270, 130
+STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION
+CAPTION "Connections"
+FONT 8, "MS Sans Serif"
+BEGIN
+    PUSHBUTTON      "Cancel",IDCANCEL,168,97,40,12
+    LISTBOX         IDC_LST_CONNECTIOS,22,35,225,56,LBS_SORT | 
+                    LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
+    PUSHBUTTON      "&Add",IDC_CMD_ADD,23,20,39,12
+    PUSHBUTTON      "&Edit",IDC_CMD_EDIT,162,20,39,12
+    PUSHBUTTON      "&Remove",IDC_CMD_REMOVE,206,20,39,12
+    COMBOBOX        IDC_CBO_TYPE,67,20,90,46,CBS_DROPDOWNLIST | WS_VSCROLL | 
+                    WS_TABSTOP
+    PUSHBUTTON      "&Save",IDC_BUTTON_SAVE,60,98,40,12
+    PUSHBUTTON      "&Load",IDC_BUTTON_LOAD,114,98,40,12
+END
+
+IDD_MEMORY_MAP DIALOGEX 0, 0, 186, 90
+STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | 
+    WS_SYSMENU
+CAPTION "Dialog"
+FONT 8, "MS Shell Dlg", 400, 0, 0x1
+BEGIN
+    DEFPUSHBUTTON   "OK",IDOK,129,7,50,14
+    PUSHBUTTON      "Annuler",IDCANCEL,129,24,50,14
+    LTEXT           "memoy mapp à remplir",IDC_STATIC,35,33,72,8
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Version
+//
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION 1,0,0,1
+ PRODUCTVERSION 1,0,0,1
+ FILEFLAGSMASK 0x3fL
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x4L
+ FILETYPE 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+    BLOCK "StringFileInfo"
+    BEGIN
+        BLOCK "040904B0"
+        BEGIN
+            VALUE "FileDescription", "Modbucfg MFC Application"
+            VALUE "FileVersion", "1, 0, 0, 1"
+            VALUE "InternalName", "Modbucfg"
+            VALUE "LegalCopyright", "Copyright (C) 1998"
+            VALUE "OriginalFilename", "Modbucfg.EXE"
+            VALUE "ProductName", "Modbucfg Application"
+            VALUE "ProductVersion", "1, 0, 0, 1"
+        END
+    END
+    BLOCK "VarFileInfo"
+    BEGIN
+        VALUE "Translation", 0x409, 1200
+    END
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// DESIGNINFO
+//
+
+#ifdef APSTUDIO_INVOKED
+GUIDELINES DESIGNINFO 
+BEGIN
+    IDD_ABOUTBOX, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 223
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 94
+    END
+
+    IDD_MODBUCFG_FORM, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 622
+        TOPMARGIN, 14
+        BOTTOMMARGIN, 460
+    END
+
+    IDD_MOD_LOCAL_COM_PARAM, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 260
+        VERTGUIDE, 260
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 185
+    END
+
+    IDD_CONNECTIONS, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 263
+        TOPMARGIN, 6
+        BOTTOMMARGIN, 123
+    END
+
+    IDD_MEMORY_MAP, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 179
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 83
+    END
+END
+#endif    // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// String Table
+//
+
+STRINGTABLE 
+BEGIN
+    IDP_OLE_INIT_FAILED     "OLE initialization failed.  Make sure that the OLE libraries are the correct version."
+    IDP_SOCKETS_INIT_FAILED "Windows sockets initialization failed."
+END
+
+STRINGTABLE 
+BEGIN
+    IDR_MAINFRAME           "Modbucfg"
+    IDR_MODBUCTYPE          "\nModbuc\nModbuc\n\n\nModbucfg.Document\nModbuc Document"
+    IDR_TRAY_ICON           "Modbus Configurator"
+END
+
+STRINGTABLE 
+BEGIN
+    AFX_IDS_APP_TITLE       "Modbucfg"
+    AFX_IDS_IDLEMESSAGE     "Ready"
+END
+
+STRINGTABLE 
+BEGIN
+    ID_INDICATOR_EXT        "EXT"
+    ID_INDICATOR_CAPS       "CAP"
+    ID_INDICATOR_NUM        "NUM"
+    ID_INDICATOR_SCRL       "SCRL"
+    ID_INDICATOR_OVR        "OVR"
+    ID_INDICATOR_REC        "REC"
+END
+
+STRINGTABLE 
+BEGIN
+    ID_FILE_NEW             "Create a new document\nNew"
+    ID_FILE_OPEN            "Open an existing document\nOpen"
+    ID_FILE_CLOSE           "Close the active document\nClose"
+    ID_FILE_SAVE            "Save the active document\nSave"
+    ID_FILE_SAVE_AS         "Save the active document with a new name\nSave As"
+END
+
+STRINGTABLE 
+BEGIN
+    ID_APP_ABOUT            "Open configuration file\nOpen"
+    ID_APP_EXIT             "Quit the application; prompts to save documents\nExit"
+END
+
+STRINGTABLE 
+BEGIN
+    ID_FILE_MRU_FILE1       "Open this document"
+    ID_FILE_MRU_FILE2       "Open this document"
+    ID_FILE_MRU_FILE3       "Open this document"
+    ID_FILE_MRU_FILE4       "Open this document"
+    ID_FILE_MRU_FILE5       "Open this document"
+    ID_FILE_MRU_FILE6       "Open this document"
+    ID_FILE_MRU_FILE7       "Open this document"
+    ID_FILE_MRU_FILE8       "Open this document"
+    ID_FILE_MRU_FILE9       "Open this document"
+    ID_FILE_MRU_FILE10      "Open this document"
+    ID_FILE_MRU_FILE11      "Open this document"
+    ID_FILE_MRU_FILE12      "Open this document"
+    ID_FILE_MRU_FILE13      "Open this document"
+    ID_FILE_MRU_FILE14      "Open this document"
+    ID_FILE_MRU_FILE15      "Open this document"
+    ID_FILE_MRU_FILE16      "Open this document"
+END
+
+STRINGTABLE 
+BEGIN
+    ID_NEXT_PANE            "Switch to the next window pane\nNext Pane"
+    ID_PREV_PANE            "Switch back to the previous window pane\nPrevious Pane"
+END
+
+STRINGTABLE 
+BEGIN
+    ID_WINDOW_NEW           "Open another window for the active document\nNew Window"
+    ID_WINDOW_ARRANGE       "Arrange icons at the bottom of the window\nArrange Icons"
+    ID_WINDOW_CASCADE       "Arrange windows so they overlap\nCascade Windows"
+    ID_WINDOW_TILE_HORZ     "Arrange windows as non-overlapping tiles\nTile Windows"
+    ID_WINDOW_TILE_VERT     "Arrange windows as non-overlapping tiles\nTile Windows"
+    ID_WINDOW_SPLIT         "Split the active window into panes\nSplit"
+END
+
+STRINGTABLE 
+BEGIN
+    ID_EDIT_CLEAR           "Erase the selection\nErase"
+    ID_EDIT_CLEAR_ALL       "Erase everything\nErase All"
+    ID_EDIT_COPY            "Copy the selection and put it on the Clipboard\nCopy"
+    ID_EDIT_CUT             "Cut the selection and put it on the Clipboard\nCut"
+    ID_EDIT_FIND            "Find the specified text\nFind"
+    ID_EDIT_PASTE           "Insert Clipboard contents\nPaste"
+    ID_EDIT_REPEAT          "Repeat the last action\nRepeat"
+    ID_EDIT_REPLACE         "Replace specific text with different text\nReplace"
+    ID_EDIT_SELECT_ALL      "Select the entire document\nSelect All"
+    ID_EDIT_UNDO            "Undo the last action\nUndo"
+    ID_EDIT_REDO            "Redo the previously undone action\nRedo"
+END
+
+STRINGTABLE 
+BEGIN
+    ID_VIEW_TOOLBAR         "Show or hide the toolbar\nToggle ToolBar"
+    ID_VIEW_STATUS_BAR      "Show or hide the status bar\nToggle StatusBar"
+END
+
+STRINGTABLE 
+BEGIN
+    AFX_IDS_SCSIZE          "Change the window size"
+    AFX_IDS_SCMOVE          "Change the window position"
+    AFX_IDS_SCMINIMIZE      "Reduce the window to an icon"
+    AFX_IDS_SCMAXIMIZE      "Enlarge the window to full size"
+    AFX_IDS_SCNEXTWINDOW    "Switch to the next document window"
+    AFX_IDS_SCPREVWINDOW    "Switch to the previous document window"
+    AFX_IDS_SCCLOSE         "Close the active window and prompts to save the documents"
+END
+
+STRINGTABLE 
+BEGIN
+    AFX_IDS_SCRESTORE       "Restore the window to normal size"
+    AFX_IDS_SCTASKLIST      "Activate Task List"
+    AFX_IDS_MDICHILD        "Activate this window"
+END
+
+STRINGTABLE 
+BEGIN
+    ID_VIEW_TEST            "Test"
+    ID_VIEW_TESTLOCALDIALOG "Test Local Dialog "
+    ID_VIEW_TESTCONNECTIONS "Test Connections"
+    ID_VIEW_TEST_CONNECTIONS "Test Connections"
+    ID_OPTIONS_CONNECTIONS  "Open/Remove Connections"
+    ID_TRAY_EXIT            "Exit Aplication"
+    ID_OPTIONS_REGISTERTYPELIBRARY "Register Type Library"
+    ID_HELP_HOWTOUSE        "display memory mapping for data acces"
+    ID_APP_MEM_MAP          "Display Memory Mapping"
+END
+
+STRINGTABLE 
+BEGIN
+    ID_TRAY_CONNECTIONS     "Configure Connections"
+    ID_TRAY_MAIN            "Test connection with modbus device "
+END
+
+#endif    // Anglais (États-Unis) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+/////////////////////////////////////////////////////////////////////////////
+// Portugais (Brésil) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_PTB)
+#ifdef _WIN32
+LANGUAGE LANG_PORTUGUESE, SUBLANG_PORTUGUESE_BRAZILIAN
+#pragma code_page(1252)
+#endif //_WIN32
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog
+//
+
+IDD_MOD_REM_PARAMETERS DIALOG  0, 0, 186, 95
+STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Remote Server Connection"
+FONT 8, "MS Sans Serif"
+BEGIN
+    DEFPUSHBUTTON   "&OK",IDOKey,24,65,50,14
+    PUSHBUTTON      "Cancel",IDCANCEL,112,65,50,14
+    GROUPBOX        "Remote Server",IDC_STATIC,13,13,159,50
+    EDITTEXT        IDC_EDIT_IP_ADDR,20,31,103,12,ES_AUTOHSCROLL
+    LTEXT           "IP Address",IDC_STATIC,20,21,49,9
+    LTEXT           "Port",IDC_STATIC,126,21,37,8
+    EDITTEXT        IDC_EDIT_PORT,127,31,42,12,ES_AUTOHSCROLL | ES_NUMBER
+    LTEXT           "Time-out (ms)",IDC_STATIC,19,50,44,9
+    EDITTEXT        IDC_EDIT_TIME_OUT,68,46,54,12,ES_AUTOHSCROLL
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// DESIGNINFO
+//
+
+#ifdef APSTUDIO_INVOKED
+GUIDELINES DESIGNINFO 
+BEGIN
+    IDD_MOD_REM_PARAMETERS, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 179
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 88
+    END
+END
+#endif    // APSTUDIO_INVOKED
+
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE 
+BEGIN
+    "resource.h\0"
+END
+
+2 TEXTINCLUDE 
+BEGIN
+    "#include ""afxres.h""\r\n"
+    "\0"
+END
+
+3 TEXTINCLUDE 
+BEGIN
+    "#define _AFX_NO_SPLITTER_RESOURCES\r\n"
+    "#define _AFX_NO_OLE_RESOURCES\r\n"
+    "#define _AFX_NO_TRACKER_RESOURCES\r\n"
+    "#define _AFX_NO_PROPERTY_RESOURCES\r\n"
+    "\r\n"
+    "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"
+    "#ifdef _WIN32\r\n"
+    "LANGUAGE 9, 1\r\n"
+    "#pragma code_page(1252)\r\n"
+    "#endif\r\n"
+    "#include ""res\\Modbucfg.rc2""  // non-Microsoft Visual C++ edited resources\r\n"
+    "#include ""afxres.rc""         // Standard components\r\n"
+    "#endif\0"
+END
+
+#endif    // APSTUDIO_INVOKED
+
+#endif    // Portugais (Brésil) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+#define _AFX_NO_SPLITTER_RESOURCES
+#define _AFX_NO_OLE_RESOURCES
+#define _AFX_NO_TRACKER_RESOURCES
+#define _AFX_NO_PROPERTY_RESOURCES
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
+#ifdef _WIN32
+LANGUAGE 9, 1
+#pragma code_page(1252)
+#endif
+#include "res\Modbucfg.rc2"  // non-Microsoft Visual C++ edited resources
+#include "afxres.rc"         // Standard components
+#endif
+/////////////////////////////////////////////////////////////////////////////
+#endif    // not APSTUDIO_INVOKED
+
Index: trunk/Modbucfg.reg
===================================================================
--- trunk/Modbucfg.reg	(revision 10)
+++ trunk/Modbucfg.reg	(revision 10)
@@ -0,0 +1,13 @@
+REGEDIT
+; This .REG file may be used by your SETUP program.
+;   If a SETUP program is not available, the entries below will be
+;   registered in your InitInstance automatically with a call to
+;   CWinApp::RegisterShellFileTypes and COleObjectFactory::UpdateRegistryAll.
+
+
+HKEY_CLASSES_ROOT\Modbucfg.Document = Modbuc Document
+HKEY_CLASSES_ROOT\Modbucfg.Document\CLSID = {A3BAD4A5-F5AE-11D1-8FE9-6CD504C1BC01}
+
+HKEY_CLASSES_ROOT\CLSID\{A3BAD4A5-F5AE-11D1-8FE9-6CD504C1BC01} = Modbuc Document
+HKEY_CLASSES_ROOT\CLSID\{A3BAD4A5-F5AE-11D1-8FE9-6CD504C1BC01}\ProgId = Modbucfg.Document
+HKEY_CLASSES_ROOT\CLSID\{A3BAD4A5-F5AE-11D1-8FE9-6CD504C1BC01}\LocalServer32 = MODBUCFG.EXE
Index: trunk/Modbucfg.sln
===================================================================
--- trunk/Modbucfg.sln	(revision 10)
+++ trunk/Modbucfg.sln	(revision 10)
@@ -0,0 +1,38 @@
+Microsoft Visual Studio Solution File, Format Version 8.00
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Modbucfg", "Modbucfg.vcproj", "{FFAC5CCC-0ABC-4F4A-91DD-5D6301555717}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Global
+	GlobalSection(SolutionConfiguration) = preSolution
+		Debug = Debug
+		Release = Release
+		Release MinDependency = Release MinDependency
+		Release MinSize = Release MinSize
+		Unicode Debug = Unicode Debug
+		Unicode Release MinDependency = Unicode Release MinDependency
+		Unicode Release MinSize = Unicode Release MinSize
+	EndGlobalSection
+	GlobalSection(ProjectDependencies) = postSolution
+	EndGlobalSection
+	GlobalSection(ProjectConfiguration) = postSolution
+		{FFAC5CCC-0ABC-4F4A-91DD-5D6301555717}.Debug.ActiveCfg = Release|Win32
+		{FFAC5CCC-0ABC-4F4A-91DD-5D6301555717}.Debug.Build.0 = Release|Win32
+		{FFAC5CCC-0ABC-4F4A-91DD-5D6301555717}.Release.ActiveCfg = Release|Win32
+		{FFAC5CCC-0ABC-4F4A-91DD-5D6301555717}.Release.Build.0 = Release|Win32
+		{FFAC5CCC-0ABC-4F4A-91DD-5D6301555717}.Release MinDependency.ActiveCfg = Release|Win32
+		{FFAC5CCC-0ABC-4F4A-91DD-5D6301555717}.Release MinDependency.Build.0 = Release|Win32
+		{FFAC5CCC-0ABC-4F4A-91DD-5D6301555717}.Release MinSize.ActiveCfg = Release|Win32
+		{FFAC5CCC-0ABC-4F4A-91DD-5D6301555717}.Release MinSize.Build.0 = Release|Win32
+		{FFAC5CCC-0ABC-4F4A-91DD-5D6301555717}.Unicode Debug.ActiveCfg = Debug|Win32
+		{FFAC5CCC-0ABC-4F4A-91DD-5D6301555717}.Unicode Debug.Build.0 = Debug|Win32
+		{FFAC5CCC-0ABC-4F4A-91DD-5D6301555717}.Unicode Release MinDependency.ActiveCfg = Release|Win32
+		{FFAC5CCC-0ABC-4F4A-91DD-5D6301555717}.Unicode Release MinDependency.Build.0 = Release|Win32
+		{FFAC5CCC-0ABC-4F4A-91DD-5D6301555717}.Unicode Release MinSize.ActiveCfg = Release|Win32
+		{FFAC5CCC-0ABC-4F4A-91DD-5D6301555717}.Unicode Release MinSize.Build.0 = Release|Win32
+	EndGlobalSection
+	GlobalSection(ExtensibilityGlobals) = postSolution
+	EndGlobalSection
+	GlobalSection(ExtensibilityAddIns) = postSolution
+	EndGlobalSection
+EndGlobal
Index: trunk/Modbucfg.vcproj
===================================================================
--- trunk/Modbucfg.vcproj	(revision 10)
+++ trunk/Modbucfg.vcproj	(revision 10)
@@ -0,0 +1,487 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="Modbucfg"
+	SccProjectName=""
+	SccLocalPath=""
+	Keyword="MFCProj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\Debug"
+			IntermediateDirectory=".\Debug"
+			ConfigurationType="1"
+			UseOfMFC="2"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\UtilClasses\Include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
+				RuntimeLibrary="3"
+				UsePrecompiledHeader="3"
+				PrecompiledHeaderThrough="stdafx.h"
+				PrecompiledHeaderFile=".\Debug/Modbucfg.pch"
+				AssemblerListingLocation=".\Debug/"
+				ObjectFile=".\Debug/"
+				ProgramDataBaseFileName=".\Debug/"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				DebugInformationFormat="4"
+				CompileAs="0"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				OutputFile=".\Debug/Modbucfg.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="TRUE"
+				AdditionalLibraryDirectories="..\ModbuLib"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile=".\Debug/Modbucfg.pdb"
+				SubSystem="2"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="_DEBUG"
+				MkTypLibCompatible="TRUE"
+				SuppressStartupBanner="TRUE"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Debug/Modbucfg.tlb"
+				HeaderFileName=""/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="1046"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\Release"
+			IntermediateDirectory=".\Release"
+			ConfigurationType="1"
+			UseOfMFC="2"
+			ATLMinimizesCRunTimeLibraryUsage="FALSE">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories="&quot;C:\Documents and Settings\Administrateur\Mes documents\xfel\downloads\modsrc02\utilclasses\include&quot;"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+				StringPooling="TRUE"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="TRUE"
+				UsePrecompiledHeader="3"
+				PrecompiledHeaderThrough="stdafx.h"
+				PrecompiledHeaderFile=".\Release/Modbucfg.pch"
+				AssemblerListingLocation=".\Release/"
+				ObjectFile=".\Release/"
+				ProgramDataBaseFileName=".\Release/"
+				WarningLevel="3"
+				SuppressStartupBanner="TRUE"
+				CompileAs="0"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="winmm.lib"
+				OutputFile=".\Release/csxfel.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="TRUE"
+				AdditionalLibraryDirectories="&quot;C:\Documents and Settings\Administrateur\Mes documents\xfel\downloads\modsrc02\ModbuLib&quot;"
+				ProgramDatabaseFile=".\Release/Modbucfg.pdb"
+				SubSystem="2"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="NDEBUG"
+				MkTypLibCompatible="TRUE"
+				SuppressStartupBanner="TRUE"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Release/Modbucfg.tlb"
+				HeaderFileName=""/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="1046"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
+			<File
+				RelativePath="ChildFrm.cpp">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="0"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="2"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="CommParameters.cpp">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="0"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="2"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="Connection.cpp">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="0"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="2"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="Connections.cpp">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="0"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="2"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="DlgConnections.cpp">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="0"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="2"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="DlgRemoteParameters.cpp">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="0"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="2"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="Globals.cpp">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="0"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="2"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="MainFrm.cpp">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="0"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="2"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="Modbucfg.cpp">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="0"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="2"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="Modbucfg.rc">
+			</File>
+			<File
+				RelativePath="ModbucfgDoc.cpp">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="0"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="2"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="ModbucfgView.cpp">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="0"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="2"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="Splash.cpp">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="0"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="2"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="StdAfx.cpp">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="0"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+						UsePrecompiledHeader="1"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						Optimization="2"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+						UsePrecompiledHeader="1"/>
+				</FileConfiguration>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl">
+			<File
+				RelativePath="ChildFrm.h">
+			</File>
+			<File
+				RelativePath="CommParameters.h">
+			</File>
+			<File
+				RelativePath="Connection.h">
+			</File>
+			<File
+				RelativePath="Connections.h">
+			</File>
+			<File
+				RelativePath="DlgConnections.h">
+			</File>
+			<File
+				RelativePath="DlgRemoteParameters.h">
+			</File>
+			<File
+				RelativePath="Globals.h">
+			</File>
+			<File
+				RelativePath="MainFrm.h">
+			</File>
+			<File
+				RelativePath="Modbucfg.h">
+			</File>
+			<File
+				RelativePath="ModbucfgDoc.h">
+			</File>
+			<File
+				RelativePath="ModbucfgView.h">
+			</File>
+			<File
+				RelativePath="Resource.h">
+			</File>
+			<File
+				RelativePath="Splash.h">
+			</File>
+			<File
+				RelativePath="StdAfx.h">
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe">
+			<File
+				RelativePath="res\idr_tray.ico">
+			</File>
+			<File
+				RelativePath="res\Modbucfg.ico">
+			</File>
+			<File
+				RelativePath="res\Modbucfg.rc2">
+			</File>
+			<File
+				RelativePath="res\ModbucfgDoc.ico">
+			</File>
+			<File
+				RelativePath="Splsh16.bmp">
+			</File>
+			<File
+				RelativePath="res\Toolbar.bmp">
+			</File>
+		</Filter>
+		<File
+			RelativePath="Modbucfg.reg">
+		</File>
+		<File
+			RelativePath="Modifications.txt">
+		</File>
+		<File
+			RelativePath="ReadMe.txt">
+		</File>
+	</Files>
+	<Globals>
+		<Global
+			Name="RESOURCE_FILE"
+			Value="Modbucfg.rc"/>
+	</Globals>
+</VisualStudioProject>
Index: trunk/ModbucfgDoc.cpp
===================================================================
--- trunk/ModbucfgDoc.cpp	(revision 10)
+++ trunk/ModbucfgDoc.cpp	(revision 10)
@@ -0,0 +1,127 @@
+// ModbucfgDoc.cpp : implementation of the CModbucfgDoc class
+//
+
+#include "stdafx.h"
+#include "Modbucfg.h"
+
+#include "ModbucfgDoc.h"
+#include "ModbucfgView.h"
+
+#include "globals.h"
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+/////////////////////////////////////////////////////////////////////////////
+// CModbucfgDoc
+
+IMPLEMENT_DYNCREATE(CModbucfgDoc, CDocument)
+
+BEGIN_MESSAGE_MAP(CModbucfgDoc, CDocument)
+	//{{AFX_MSG_MAP(CModbucfgDoc)
+		// NOTE - the ClassWizard will add and remove mapping macros here.
+		//    DO NOT EDIT what you see in these blocks of generated code!
+	//}}AFX_MSG_MAP
+END_MESSAGE_MAP()
+
+BEGIN_DISPATCH_MAP(CModbucfgDoc, CDocument)
+	//{{AFX_DISPATCH_MAP(CModbucfgDoc)
+		// NOTE - the ClassWizard will add and remove mapping macros here.
+		//      DO NOT EDIT what you see in these blocks of generated code!
+	//}}AFX_DISPATCH_MAP
+END_DISPATCH_MAP()
+
+// Note: we add support for IID_IModbucfg to support typesafe binding
+//  from VBA.  This IID must match the GUID that is attached to the 
+//  dispinterface in the .ODL file.
+
+// {A3BAD4A7-F5AE-11D1-8FE9-6CD504C1BC01}
+static const IID IID_IModbucfg =
+{ 0xa3bad4a7, 0xf5ae, 0x11d1, { 0x8f, 0xe9, 0x6c, 0xd5, 0x4, 0xc1, 0xbc, 0x1 } };
+
+BEGIN_INTERFACE_MAP(CModbucfgDoc, CDocument)
+	INTERFACE_PART(CModbucfgDoc, IID_IModbucfg, Dispatch)
+END_INTERFACE_MAP()
+
+/////////////////////////////////////////////////////////////////////////////
+// CModbucfgDoc construction/destruction
+
+CModbucfgDoc::CModbucfgDoc()
+{
+	// TODO: add one-time construction code here
+
+	EnableAutomation();
+
+	AfxOleLockApp();
+}
+
+CModbucfgDoc::~CModbucfgDoc()
+{
+	AfxOleUnlockApp();
+}
+
+BOOL CModbucfgDoc::OnNewDocument()
+{
+	if (!CDocument::OnNewDocument())
+		return FALSE;
+
+	if (gConnections.GetCount()<1) {
+		AfxMessageBox(_T("There are no connections to open new document"));
+		return FALSE;
+	}
+
+	return TRUE;
+}
+
+
+
+/////////////////////////////////////////////////////////////////////////////
+// CModbucfgDoc serialization
+
+void CModbucfgDoc::Serialize(CArchive& ar)
+{
+	if (ar.IsStoring())
+	{
+		// TODO: add storing code here
+	}
+	else
+	{
+		// TODO: add loading code here
+	}
+}
+
+/////////////////////////////////////////////////////////////////////////////
+// CModbucfgDoc diagnostics
+
+#ifdef _DEBUG
+void CModbucfgDoc::AssertValid() const
+{
+	CDocument::AssertValid();
+}
+
+void CModbucfgDoc::Dump(CDumpContext& dc) const
+{
+	CDocument::Dump(dc);
+}
+#endif //_DEBUG
+
+/////////////////////////////////////////////////////////////////////////////
+// CModbucfgDoc commands
+
+void CModbucfgDoc::OnCloseDocument() 
+{
+	// TODO: Add your specialized code here and/or call the base class
+	CWaitCursor wait;    // display wait cursor
+	POSITION pos = GetFirstViewPosition();  
+	while (pos != NULL)   {
+      CModbucfgView* pModbucfgView = (CModbucfgView*)GetNextView(pos);   
+	  pModbucfgView->Stop();
+	  while (pModbucfgView->IsBusy()) {
+		  CThinThread::DoEvents();
+	  }
+	}   
+	CDocument::OnCloseDocument();
+}
Index: trunk/ModbucfgDoc.h
===================================================================
--- trunk/ModbucfgDoc.h	(revision 10)
+++ trunk/ModbucfgDoc.h	(revision 10)
@@ -0,0 +1,66 @@
+// ModbucfgDoc.h : interface of the CModbucfgDoc class
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#if !defined(AFX_MODBUCFGDOC_H__A3BAD4B3_F5AE_11D1_8FE9_6CD504C1BC01__INCLUDED_)
+#define AFX_MODBUCFGDOC_H__A3BAD4B3_F5AE_11D1_8FE9_6CD504C1BC01__INCLUDED_
+
+#if _MSC_VER >= 1000
+#pragma once
+#endif // _MSC_VER >= 1000
+
+
+class CModbucfgDoc : public CDocument
+{
+protected: // create from serialization only
+	CModbucfgDoc();
+	DECLARE_DYNCREATE(CModbucfgDoc)
+
+// Attributes
+public:
+
+// Operations
+public:
+
+// Overrides
+	// ClassWizard generated virtual function overrides
+	//{{AFX_VIRTUAL(CModbucfgDoc)
+	public:
+	virtual BOOL OnNewDocument();
+	virtual void Serialize(CArchive& ar);
+	virtual void OnCloseDocument();
+	//}}AFX_VIRTUAL
+
+// Implementation
+public:
+	virtual ~CModbucfgDoc();
+#ifdef _DEBUG
+	virtual void AssertValid() const;
+	virtual void Dump(CDumpContext& dc) const;
+#endif
+
+protected:
+
+// Generated message map functions
+protected:
+	//{{AFX_MSG(CModbucfgDoc)
+		// NOTE - the ClassWizard will add and remove member functions here.
+		//    DO NOT EDIT what you see in these blocks of generated code !
+	//}}AFX_MSG
+	DECLARE_MESSAGE_MAP()
+
+	// Generated OLE dispatch map functions
+	//{{AFX_DISPATCH(CModbucfgDoc)
+		// NOTE - the ClassWizard will add and remove member functions here.
+		//    DO NOT EDIT what you see in these blocks of generated code !
+	//}}AFX_DISPATCH
+	DECLARE_DISPATCH_MAP()
+	DECLARE_INTERFACE_MAP()
+};
+
+/////////////////////////////////////////////////////////////////////////////
+
+//{{AFX_INSERT_LOCATION}}
+// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
+
+#endif // !defined(AFX_MODBUCFGDOC_H__A3BAD4B3_F5AE_11D1_8FE9_6CD504C1BC01__INCLUDED_)
Index: trunk/ModbucfgView.cpp
===================================================================
--- trunk/ModbucfgView.cpp	(revision 10)
+++ trunk/ModbucfgView.cpp	(revision 10)
@@ -0,0 +1,1332 @@
+// ModbucfgView.cpp : implementation of the CModbucfgView class
+//
+
+#include "stdafx.h"
+#include "Modbucfg.h"
+
+#include "ModbucfgDoc.h"
+#include "ModbucfgView.h"
+#include ".\modbucfgview.h"
+
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+/////////////////////////////////////////////////////////////////////////////
+// CModbucfgView
+
+IMPLEMENT_DYNCREATE(CModbucfgView, CFormView)
+
+BEGIN_MESSAGE_MAP(CModbucfgView, CFormView)
+	//{{AFX_MSG_MAP(CModbucfgView)
+	ON_BN_CLICKED(IDC_CHK_Enable_Poll, OnchkEnablePoll)
+	ON_EN_CHANGE(IDC_EDIT_INTERVAL, OnChangeEditInterval)
+	ON_BN_CLICKED(IDC_CMD_WRITE, OnCmdWrite)
+	//}}AFX_MSG_MAP
+	ON_CBN_SELCHANGE(IDC_CBO_READ_FUNCTION, OnCbnSelchangeCboReadFunction)
+	ON_CBN_SELCHANGE(IDC_CBO_WRITE_FUNCTION, OnCbnSelchangeCboWriteFunction)
+	ON_COMMAND(ID_APP_MEM_MAP, OnAppMemMap)
+	ON_EN_CHANGE(IDC_EDIT_QUANT, OnEnChangeEditQuant)
+	ON_EN_CHANGE(IDC_EDIT_ADDR, OnEnChangeEditAddr)
+	ON_EN_CHANGE(IDC_EDIT_QUANT_2, OnEnChangeEditQuant2)
+	ON_LBN_SELCHANGE(IDC_LIST5, OnLbnSelchangeList5)
+	ON_LBN_SELCHANGE(IDC_LST_VALUES, OnLbnSelchangeLstValues)
+	ON_EN_CHANGE(IDC_EDIT_ADDR_WRI, OnEnChangeEditAddrWri)
+	ON_EN_CHANGE(IDC_EDIT_VALUE, OnEnChangeEditValue)
+	ON_WM_VSCROLL()
+	ON_BN_CLICKED(IDC_CMD_READ, OnCmdRead)
+	ON_EN_CHANGE(IDC_EDIT16, OnEnChangeEdit16)
+	ON_BN_CLICKED(IDC_BUTTON1, OnBnClickedButton1)
+	ON_BN_CLICKED(IDC_BUTTON2, OnBnClickedButton2)
+END_MESSAGE_MAP()
+
+/////////////////////////////////////////////////////////////////////////////
+// CModbucfgView construction/destruction
+
+CModbucfgView::CModbucfgView()
+	: CFormView(CModbucfgView::IDD)
+/*	, m_edtQuant2(false)
+	, m_edtQuant2(_T(""))*/
+	, m_spinIndex(0)
+{
+	//{{AFX_DATA_INIT(CModbucfgView)
+	//}}AFX_DATA_INIT
+	// TODO: add construction code here
+
+}
+
+CModbucfgView::~CModbucfgView()
+{
+}
+
+void CModbucfgView::DoDataExchange(CDataExchange* pDX)
+{
+	CFormView::DoDataExchange(pDX);
+	//{{AFX_DATA_MAP(CModbucfgView)
+	DDX_Control(pDX, IDC_CBO_DATA_TYPE, m_cboDataType);
+	DDX_Control(pDX, IDC_EDIT_INTERVAL, m_edtInterval);
+	DDX_Control(pDX, IDC_CHK_Enable_Poll, m_butPollEnable);
+	DDX_Control(pDX, IDC_STAT_STATUS, m_statStatus);
+	DDX_Control(pDX, IDC_STAT_ERROR, m_staError);
+	DDX_Control(pDX, IDC_LST_VALUES, m_lstValues);
+	DDX_Control(pDX, IDC_CBO_WRITE_FUNCTION, m_cboWriteFunctions);
+	DDX_Control(pDX, IDC_CBO_READ_FUNCTION, m_cboReadFunctions);
+	DDX_Control(pDX, IDC_CBO_CONNECTION, m_cboConnections);
+	DDX_Control(pDX, IDC_EDIT_VALUE, m_edtValue);
+	DDX_Control(pDX, IDC_EDIT_QUANT, m_edtQuant);
+	DDX_Control(pDX, IDC_EDIT_DEVICE, m_edtDevice);
+	DDX_Control(pDX, IDC_EDIT_ADDR_WRI, m_edtWriteAddr);
+	DDX_Control(pDX, IDC_EDIT_ADDR, m_edtReadAddr);
+	DDX_Control(pDX, IDC_CMD_WRITE, m_cmdWrite);
+	//}}AFX_DATA_MAP
+	DDX_Control(pDX, IDC_EDIT_QUANT_2, m_edtQuant2);
+	//	DDX_Control(pDX, IDC_LIST5, m_list5Values);
+	DDX_Control(pDX, IDC_EDIT6, m_edtIndex);
+	DDX_Text(pDX, IDC_EDIT6, m_spinIndex);
+	DDX_Control(pDX, IDC_EDIT3, m_readEil);
+	DDX_Control(pDX, IDC_EDIT5, m_readSVd);
+	DDX_Control(pDX, IDC_EDIT7, m_readSVfin);
+	DDX_Control(pDX, IDC_EDIT8, m_readSV1);
+	DDX_Control(pDX, IDC_EDIT9, m_readSV2);
+	DDX_Control(pDX, IDC_EDIT10, m_readdtp);
+	DDX_Control(pDX, IDC_EDIT11, m_readdt);
+	DDX_Control(pDX, IDC_EDIT12, m_readdP);
+	DDX_Control(pDX, IDC_EDIT13, m_readdPsecu);
+	DDX_Control(pDX, IDC_EDIT14, m_readSVil);
+	DDX_Control(pDX, IDC_EDIT15, m_readSleil);
+	DDX_Control(pDX, IDC_EDIT16, m_readSTc);
+	DDX_Control(pDX, IDC_EDIT17, m_readNbal_max);
+	DDX_Control(pDX, IDC_EDIT18, m_readFr);
+	DDX_Control(pDX, IDC_EDIT19, m_readN_cur);
+	DDX_Control(pDX, IDC_CMD_READ, m_cmdRead);
+	DDX_Control(pDX, IDC_EDIT4, m_readNil);
+	DDX_Control(pDX, IDC_EDIT20, m_readNil_stat);
+	DDX_Control(pDX, IDC_EDIT21, m_readP_last);
+	DDX_Control(pDX, IDC_EDIT22, m_readN_last);
+	DDX_Control(pDX, IDC_EDIT23, m_readdPil);
+	DDX_Control(pDX, IDC_EDIT24, m_readV_cur);
+	DDX_Control(pDX, IDC_EDIT25, m_readPic);
+	DDX_Control(pDX, IDC_EDIT26, m_readTimer);
+	DDX_Control(pDX, IDC_EDIT27, m_readNbal);
+	DDX_Control(pDX, IDC_EDIT28, m_readP_cde);
+	DDX_Control(pDX, IDC_EDIT29, m_readPp);
+	DDX_Control(pDX, IDC_EDIT30, m_readStat_C_1);
+	DDX_Control(pDX, IDC_EDIT31, m_readStat_C_2);
+	DDX_Control(pDX, IDC_EDIT32, m_readStat_C_3);
+	DDX_Control(pDX, IDC_EDIT33, m_readStat_C_4);
+	DDX_Control(pDX, IDC_EDIT34, m_readStat_C_5);
+	DDX_Control(pDX, IDC_EDIT35, m_readStat_C_6);
+	DDX_Control(pDX, IDC_EDIT36, m_readStat_C_7);
+	DDX_Control(pDX, IDC_EDIT37, m_readStat_C_8);
+	DDX_Control(pDX, IDC_EDIT38, m_readNum_C1a);
+	DDX_Control(pDX, IDC_EDIT39, m_readNum_C1b);
+	DDX_Control(pDX, IDC_EDIT40, m_readNum_C2a);
+	DDX_Control(pDX, IDC_EDIT41, m_readNum_C2b);
+	DDX_Control(pDX, IDC_EDIT42, m_readNum_C3a);
+	DDX_Control(pDX, IDC_EDIT43, m_readNum_C3b);
+	DDX_Control(pDX, IDC_EDIT44, m_readNum_C4a);
+	DDX_Control(pDX, IDC_EDIT45, m_readNum_C4b);
+	DDX_Control(pDX, IDC_EDIT54, m_readN_Seqcond);
+	DDX_Control(pDX, IDC_EDIT57, m_readMAP);
+	DDX_Control(pDX, IDC_EDIT46, m_readTemp_cond_1);
+	DDX_Control(pDX, IDC_EDIT47, m_readTemp_cond_2);
+	DDX_Control(pDX, IDC_EDIT48, m_readTemp_cond_3);
+	DDX_Control(pDX, IDC_EDIT49, m_readTemp_cond_4);
+	DDX_Control(pDX, IDC_EDIT50, m_readTemp_cond_5);
+	DDX_Control(pDX, IDC_EDIT51, m_readTemp_cond_6);
+	DDX_Control(pDX, IDC_EDIT52, m_readTemp_cond_7);
+	DDX_Control(pDX, IDC_EDIT53, m_readTemp_cond_8);
+	DDX_Control(pDX, IDC_EDIT58, m_readStat_C_9);
+	DDX_Control(pDX, IDC_EDIT59, m_readStat_C_10);
+	DDX_Control(pDX, IDC_EDIT60, m_readStat_C_11);
+	DDX_Control(pDX, IDC_EDIT61, m_readStat_C_12);
+	DDX_Control(pDX, IDC_EDIT62, m_readTemp_cond_9);
+	DDX_Control(pDX, IDC_EDIT63, m_readTemp_cond_10);
+	DDX_Control(pDX, IDC_EDIT64, m_readTemp_cond_11);
+	DDX_Control(pDX, IDC_EDIT65, m_readTemp_cond_12);
+}
+
+BOOL CModbucfgView::PreCreateWindow(CREATESTRUCT& cs)
+{
+	// TODO: Modify the Window class or styles here by modifying
+	//  the CREATESTRUCT cs
+
+	return CFormView::PreCreateWindow(cs);
+}
+
+/////////////////////////////////////////////////////////////////////////////
+// CModbucfgView diagnostics
+
+#ifdef _DEBUG
+void CModbucfgView::AssertValid() const
+{
+	CFormView::AssertValid();
+}
+
+void CModbucfgView::Dump(CDumpContext& dc) const
+{
+	CFormView::Dump(dc);
+}
+
+CModbucfgDoc* CModbucfgView::GetDocument() // non-debug version is inline
+{
+	ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CModbucfgDoc)));
+	return (CModbucfgDoc*)m_pDocument;
+}
+#endif //_DEBUG
+
+/////////////////////////////////////////////////////////////////////////////
+// CModbucfgView message handlers
+
+void CModbucfgView::OnInitialUpdate() 
+{
+	CFormView::OnInitialUpdate();
+	
+	// TODO: Add your specialized code here and/or call the base class
+	LoadControls();
+
+	//Dans le cas d'une CFormView, les ascenseurs apparaissent automatiquement dès que 
+	//la surface cliente de la fenêtre devient trop petite par rapport à la surface réelle.
+	//pour ne pas avoir à gérer les ascenseurs, je les supprime: une CFormView hérite de la classe CSCrollView 
+	//qui dispose de la fonction SetScaleToFitSize pour adapter la surface de la fenêtre à la taille fenêtrée
+	CRect Rect;
+    GetParentFrame()->GetWindowRect(&Rect);
+    SIZE size;
+    size.cx=Rect.Width();
+    size.cy=Rect.Height();
+    SetScaleToFitSize(size);
+
+	//controle spin
+	CSpinButtonCtrl* pSpin=(CSpinButtonCtrl*)GetDlgItem(IDC_SPIN2);
+	pSpin->SetRange(0,100);//plage du control : 0-100
+	pSpin->SetPos((int)m_spinIndex * 1);//valeur initiale 1
+
+	//tableaux pour les write multiple
+	m_bValueMultiple.SetSize(100);
+	m_sValueMultiple.SetSize(100);
+	m_wValueMultiple.SetSize(100);
+	m_fValueMultiple.SetSize(100);
+	m_dValueMultiple.SetSize(100);
+
+}
+
+void CModbucfgView::LoadControls()
+{
+	CString str;
+	CString sKey;
+	CConnection* pConnection;
+	POSITION pos;
+
+	//Read functions 
+	m_cboReadFunctions.AddString(CString("LoopbackTest"));
+	m_cboReadFunctions.AddString(CString("Holding Registers"));
+	m_cboReadFunctions.AddString(CString("Input Registers"));
+	m_cboReadFunctions.AddString(CString("Coil Status"));
+	m_cboReadFunctions.AddString(CString("Discrete Inputs"));
+	m_cboReadFunctions.SetCurSel(1);
+	
+	//Write Functions 
+	m_cboWriteFunctions.AddString(CString("Single Register"));
+	m_cboWriteFunctions.AddString(CString("Single Coil"));
+	m_cboWriteFunctions.AddString(CString("Multiple Registers"));
+	m_cboWriteFunctions.AddString(CString("Multiple Coils"));
+	m_cboWriteFunctions.SetCurSel(0);
+
+
+	pos = gConnections.GetStartPosition();
+	
+	m_cboConnections.ResetContent();
+
+	while (NULL!=pos) {
+		gConnections.GetNextAssoc(pos,sKey,pConnection);
+		m_cboConnections.AddString(sKey);
+	}
+
+	m_cboConnections.SetCurSel(0);
+
+
+	//Default Values 
+	str=_T("1");
+    m_edtDevice.SetWindowText(str);
+	
+	str=_T("0");
+	m_edtValue.SetWindowText(str);
+	m_edtWriteAddr.SetWindowText(str);
+	m_edtReadAddr.SetWindowText(str);
+
+	str=_T("10");
+	m_edtQuant.SetWindowText(str);
+
+	str=_T("1000");
+	m_edtInterval.SetWindowText(str);
+
+	str=_T("10");
+	m_edtQuant2.SetWindowText(str);
+
+	//Data Type 
+	m_cboDataType.AddString(CString("char"));
+	m_cboDataType.AddString(CString("signed - 16"));
+	m_cboDataType.AddString(CString("unsigned - 16"));
+	m_cboDataType.AddString(CString("float - 32"));
+	m_cboDataType.AddString(CString("float - 32 reverse"));
+	m_cboDataType.AddString(CString("double - 64"));
+	m_cboDataType.AddString(CString("double - 64 reverse"));
+	m_cboDataType.SetCurSel(1);
+
+	//associe la variable m_readVacuum à la ressource IDC_LIST2
+	m_readVacuum = (CListCtrl*)GetDlgItem (IDC_LIST2);
+	//
+	m_readVacuum->SetExtendedStyle(LVS_REPORT | LVS_EX_FULLROWSELECT);
+	//ajout des titres
+	m_readVacuum->InsertColumn(0,_T("Name"),LVCFMT_CENTER,50);
+	m_readVacuum->InsertColumn(1,_T("value(mbar)"),LVCFMT_CENTER,100);
+	m_readVacuum->SetBkColor(RGB(202,202,255));
+	//nb de lignes
+//	m_readVacuum->SetItemCount(12);
+	//init tableau
+	for (int i=0;i < 12;i++)
+	{
+		str.Format(TEXT("V%d"), i+1);
+		// Insert the item, select every other item.
+		m_readVacuum->InsertItem(LVIF_TEXT|LVIF_STATE, i, str, 
+      (i%2)==0 ? LVIS_SELECTED : 0, LVIS_SELECTED,0, 0);
+		m_readVacuum->SetItemText(i,1,"0");
+	}
+
+	//associe la variable m_readCondParam à la ressource IDC_LIST3
+	m_readCondParam = (CListCtrl*)GetDlgItem (IDC_LIST3);
+	//
+	m_readCondParam->SetExtendedStyle(LVS_REPORT | LVS_EX_FULLROWSELECT);
+	//ajout des titres
+	m_readCondParam->InsertColumn(0,_T("step number"),LVCFMT_CENTER,40);
+	m_readCondParam->InsertColumn(1,_T("Pi_min"),LVCFMT_CENTER,50);
+	m_readCondParam->InsertColumn(1,_T("Pi_max"),LVCFMT_CENTER,50);
+	m_readCondParam->InsertColumn(1,_T("Tn_max"),LVCFMT_CENTER,50);
+	m_readCondParam->InsertColumn(1,_T("Tp_max"),LVCFMT_CENTER,50);
+	m_readCondParam->InsertColumn(1,_T("Ln(us)"),LVCFMT_CENTER,50);
+	//init tableau
+	for (int i=0;i < 12;i++)
+	{
+		str.Format(TEXT("%d"), i+1);
+		// Insert the item, select every other item.
+		m_readCondParam->InsertItem(LVIF_TEXT|LVIF_STATE, i, str, 
+      (i%2)==0 ? LVIS_SELECTED : 0, LVIS_SELECTED,0, 0);
+	}
+}
+
+void CModbucfgView::StartWork()
+{
+	SCODE sc = ::CoInitializeEx(NULL,COINIT_MULTITHREADED);
+	//SCODE sc = ::CoInitializeEx(NULL,COINIT_APARTMENTTHREADED); 
+
+	if (FAILED(sc))
+	{
+		// warn about non-NULL success codes
+		TRACE1("Warning: OleInitialize returned scode = %x",sc);
+	}
+
+	m_dwCount=0;
+	m_dwSum=0;
+	m_dwErrors=0;
+}
+
+void CModbucfgView::DoWork()
+{
+	ldiv_t div_result;
+    float fUpdateSpeed;
+	DWORD dwTime;
+	CString str;
+	WORD nError;
+	static int iFunction=0;
+    
+	int iNumLoops=10;
+	
+	
+	fUpdateSpeed=0.0;
+	
+	if ((m_cboReadFunctions.GetCurSel()>=LOOP_BACK_TEST)&&
+		(m_cboReadFunctions.GetCurSel()<=READ_INPUT_STATUS)){
+		
+		m_dwCount++;
+//		nError=ExecuteReadFunction(m_cboReadFunctions.GetCurSel(),dwTime,str);
+		nError=ExecuteReadFunction(iFunction++,dwTime,str);
+		if (iFunction==6)iFunction=0;
+		m_dwSum +=dwTime;  
+		
+		div_result = ldiv(m_dwCount,iNumLoops);
+		
+		if (CModbus::ERR_OK!=nError){
+			m_dwErrors++;
+		}
+		
+		if (0==div_result.rem){
+			fUpdateSpeed=(float)(iNumLoops*1000)/(float)m_dwSum;
+			m_dwSum=0; 
+		}
+		else {
+			fUpdateSpeed=(float)(1*1000)/(float)dwTime;
+		}
+
+		m_staError.SetWindowText(str);
+		str.Format("%d Errors=%d  %4.2f(Up./s) ",m_dwCount,m_dwErrors,fUpdateSpeed);  
+		m_statStatus.SetWindowText(str);
+	}
+	
+			
+}
+
+void CModbucfgView::EndWork()
+{
+	::CoUninitialize();
+}
+
+void CModbucfgView::OnchkEnablePoll() 
+{
+	CString sText;
+	DWORD dwInterval=0;
+
+	m_edtInterval.GetWindowText(sText);
+	dwInterval=DWORD(atol(sText));
+	
+//	if (dwInterval>10000) {
+	if ((dwInterval>10000) || (dwInterval<200)) {
+		AfxMessageBox("Max. is 10000 ms and Min. is 200 ms");
+		dwInterval=10000;
+		sText.Format("%d",dwInterval);
+		m_edtInterval.SetWindowText(sText);
+		return;
+	}
+
+	if (0!=m_butPollEnable.GetCheck()) {
+		if (!IsBusy()) {
+			CreateThread(0,0,NULL,dwInterval);
+		}
+		m_butPollEnable.SetCheck(1);
+	}
+	else {
+		Stop();
+	}
+}
+
+
+WORD CModbucfgView::ExecuteReadFunction(int iFunction,DWORD& dwTime, CString& rErrorMessage)
+{
+	CModbus* pModbus;
+	CShortArray aValues;
+	CByteArray abCoilValues;
+	
+	CFloatArray afValues;
+	CDblArray adValues;
+
+    CString str;
+	CString sAux;
+    WORD nError;
+	int i;
+	BOOL bRegisters;
+	DWORD dwStart;
+	CString sKey;
+	CConnection* pConnection =NULL;
+	BYTE byDevice;
+	WORD wQuant;
+	WORD wAddr;
+	int nIndex;
+	int nPreviusCount;
+	int iDataType;
+
+	CListCtrl* vacuum = (CListCtrl*)GetDlgItem (IDC_LIST2);
+	CListCtrl* parameters = (CListCtrl*)GetDlgItem (IDC_LIST3);
+
+	i=m_cboConnections.GetCurSel();
+	if (i<0) {
+		return 0;
+	}
+	else {
+		m_cboConnections.GetLBText(i,sKey);
+		
+		if (gConnections.Lookup(sKey,pConnection)) {
+		
+			pModbus=pConnection->m_pModbus;
+		}
+		else {
+			ASSERT(FALSE);
+			return 0;
+		}
+	}
+
+	m_edtDevice.GetWindowText(str);
+	byDevice=BYTE(atoi(str));
+
+	switch (iFunction)
+	{
+	case 0:
+	//coils : case READ_OUTPUT_STATUS
+	wQuant=13;
+	abCoilValues.SetSize(wQuant);
+	wAddr=3000;
+	nError=pModbus->ReadOutputStatus(byDevice,wAddr,wQuant, abCoilValues);
+
+	str.Format("%d",abCoilValues[0]);
+	m_readEil.SetWindowText(str);
+	str.Format("%d",abCoilValues[1]);
+	m_readStat_C_1.SetWindowText(str);		
+	str.Format("%d",abCoilValues[2]);
+	m_readStat_C_2.SetWindowText(str);		
+	str.Format("%d",abCoilValues[3]);
+	m_readStat_C_3.SetWindowText(str);		
+	str.Format("%d",abCoilValues[4]);
+	m_readStat_C_4.SetWindowText(str);		
+	str.Format("%d",abCoilValues[5]);
+	m_readStat_C_5.SetWindowText(str);		
+	str.Format("%d",abCoilValues[6]);
+	m_readStat_C_6.SetWindowText(str);		
+	str.Format("%d",abCoilValues[7]);
+	m_readStat_C_7.SetWindowText(str);		
+	str.Format("%d",abCoilValues[8]);
+	m_readStat_C_8.SetWindowText(str);		
+	str.Format("%d",abCoilValues[9]);
+	m_readStat_C_9.SetWindowText(str);		
+	str.Format("%d",abCoilValues[10]);
+	m_readStat_C_10.SetWindowText(str);		
+	str.Format("%d",abCoilValues[11]);
+	m_readStat_C_11.SetWindowText(str);		
+	str.Format("%d",abCoilValues[12]);
+	m_readStat_C_12.SetWindowText(str);		
+	break;
+
+	case 1:
+	//holdings : case READ_OUTPUT_REGISTERS:		
+//	iDataType = DATA_UNSIGNED_16;
+	wQuant=125;
+	aValues.SetSize(wQuant);
+	wAddr=2000;
+	nError=pModbus->ReadOutputRegisters(byDevice,wAddr,wQuant, aValues);
+
+	str.Format("%d",aValues[0]);
+	m_readSVd.SetWindowText(str);		
+	str.Format("%d",aValues[1]);
+	m_readSVfin.SetWindowText(str);		
+	str.Format("%d",aValues[2]);
+	m_readSV1.SetWindowText(str);		
+	str.Format("%d",aValues[3]);
+	m_readSV2.SetWindowText(str);		
+	str.Format("%d",aValues[4]);
+	m_readdtp.SetWindowText(str);		
+	str.Format("%d",aValues[5]);
+	m_readdt.SetWindowText(str);
+	str.Format("%d",aValues[20]);
+	m_readSVil.SetWindowText(str);		
+	str.Format("%d",aValues[25]);
+	m_readNbal_max.SetWindowText(str);		
+	str.Format("%d",aValues[26]);
+	m_readFr.SetWindowText(str);		
+	str.Format("%d",aValues[27]);
+	m_readN_cur.SetWindowText(str);		
+	str.Format("%d",aValues[30]);
+	m_readNil.SetWindowText(str);		
+	str.Format("%d",aValues[31]);
+	m_readNil_stat.SetWindowText(str);		
+	str.Format("%d",aValues[34]);
+	m_readN_last.SetWindowText(str);		
+	str.Format("%d",aValues[37]);
+	m_readV_cur.SetWindowText(str);		
+	str.Format("%d",(aValues[40]<<16)+aValues[41]);//2 mots de 16 bits
+	m_readTimer.SetWindowText(str);		
+	str.Format("%d",aValues[42]);
+	m_readNbal.SetWindowText(str);		
+	str.Format("%d",aValues[47]);
+	m_readN_Seqcond.SetWindowText(str);		
+	str.Format("%d",aValues[48]);
+	m_readMAP.SetWindowText(str);		
+	str.Format("%d",aValues[50]);
+	m_readNum_C1a.SetWindowText(str);		
+	str.Format("%d",aValues[51]);
+	m_readNum_C1b.SetWindowText(str);		
+	str.Format("%d",aValues[52]);
+	m_readNum_C2a.SetWindowText(str);		
+	str.Format("%d",aValues[53]);
+	m_readNum_C2b.SetWindowText(str);		
+	str.Format("%d",aValues[54]);
+	m_readNum_C3a.SetWindowText(str);		
+	str.Format("%d",aValues[55]);
+	m_readNum_C3b.SetWindowText(str);		
+	str.Format("%d",aValues[56]);
+	m_readNum_C4a.SetWindowText(str);		
+	str.Format("%d",aValues[57]);
+	m_readNum_C4b.SetWindowText(str);		
+	str.Format("%d",(aValues[58]<<16)+aValues[59]);//2 mots de 16 bits
+	m_readTemp_cond_1.SetWindowText(str);		
+	str.Format("%d",(aValues[60]<<16)+aValues[61]);//2 mots de 16 bits
+	m_readTemp_cond_2.SetWindowText(str);		
+	str.Format("%d",(aValues[62]<<16)+aValues[63]);//2 mots de 16 bits
+	m_readTemp_cond_3.SetWindowText(str);		
+	str.Format("%d",(aValues[64]<<16)+aValues[65]);//2 mots de 16 bits
+	m_readTemp_cond_4.SetWindowText(str);		
+	str.Format("%d",(aValues[66]<<16)+aValues[67]);//2 mots de 16 bits
+	m_readTemp_cond_5.SetWindowText(str);		
+	str.Format("%d",(aValues[68]<<16)+aValues[69]);//2 mots de 16 bits
+	m_readTemp_cond_6.SetWindowText(str);		
+	str.Format("%d",(aValues[70]<<16)+aValues[71]);//2 mots de 16 bits
+	m_readTemp_cond_7.SetWindowText(str);		
+	str.Format("%d",(aValues[72]<<16)+aValues[73]);//2 mots de 16 bits
+	m_readTemp_cond_8.SetWindowText(str);		
+	str.Format("%d",(aValues[74]<<16)+aValues[75]);//2 mots de 16 bits
+	m_readTemp_cond_9.SetWindowText(str);		
+	str.Format("%d",(aValues[76]<<16)+aValues[77]);//2 mots de 16 bits
+	m_readTemp_cond_10.SetWindowText(str);		
+	str.Format("%d",(aValues[78]<<16)+aValues[79]);//2 mots de 16 bits
+	m_readTemp_cond_11.SetWindowText(str);		
+	str.Format("%d",(aValues[80]<<16)+aValues[81]);//2 mots de 16 bits
+	m_readTemp_cond_12.SetWindowText(str);		
+	break;
+
+	case 2:
+	//holdings : case READ_OUTPUT_REGISTERS:		
+//	iDataType = DATA_FLOAT;
+	wQuant=17;
+	afValues.SetSize(wQuant);
+	wAddr=2006;
+	nError=pModbus->ReadOutputRegisters(byDevice,wAddr,wQuant, afValues);
+
+	str.Format("%g",afValues[0]);
+	m_readdP.SetWindowText(str);		
+	str.Format("%g",afValues[1]);
+	m_readdPsecu.SetWindowText(str);
+	str.Format("%g",afValues[13]);
+	m_readP_last.SetWindowText(str);
+	str.Format("%g",afValues[16]);
+	m_readPic.SetWindowText(str);
+	break;
+
+	case 3:
+	//holdings : case READ_OUTPUT_REGISTERS:		
+//	iDataType = DATA_FLOAT;
+	wQuant=24;
+	afValues.SetSize(wQuant);
+	wAddr=2021;
+	nError=pModbus->ReadOutputRegisters(byDevice,wAddr,wQuant, afValues);
+
+	str.Format("%g",afValues[0]);
+	m_readSleil.SetWindowText(str);
+	str.Format("%g",afValues[1]);
+	m_readSTc.SetWindowText(str);
+	str.Format("%g",afValues[7]);
+	m_readdPil.SetWindowText(str);
+	str.Format("%g",afValues[11]);
+	m_readP_cde.SetWindowText(str);
+	str.Format("%g",afValues[12]);
+	m_readPp.SetWindowText(str);
+	break;
+
+	case 4:
+	//holdings : case READ_OUTPUT_REGISTERS:		
+//	iDataType = DATA_FLOAT;
+	wQuant=24;
+	afValues.SetSize(wQuant);
+	wAddr=/*2108*/2116;
+	nError=pModbus->ReadOutputRegisters(byDevice,wAddr,wQuant, afValues);
+
+	//Pi_max
+	for (int i=0;i < 12;i++)
+	{
+		str.Format("%g",afValues[i]);
+		parameters->SetItemText(i,4,str);
+	}
+	//Pi_min
+	for (int i=12;i < 24;i++)
+	{
+		str.Format("%g",afValues[i]);
+		parameters->SetItemText(i-12,5,str);
+	}
+	break;
+
+	case 5:
+	//holdings : case READ_OUTPUT_REGISTERS:		
+//	iDataType = DATA_UNSIGNED_16;
+	wQuant=125;
+	aValues.SetSize(wQuant);
+	wAddr=2080;
+	nError=pModbus->ReadOutputRegisters(byDevice,wAddr,wQuant, aValues);
+	//Ln
+	for (int i=0;i < 12;i++)
+	{
+		str.Format("%d",aValues[i]);
+		parameters->SetItemText(i,1,str);
+	}
+	//Tn_max
+	for (int i=12;i < 24;i++)
+	{
+		str.Format("%d",aValues[i]);
+		parameters->SetItemText(i-12,3,str);
+	}
+	//Tp_max : 12 mots de 16 bits ????
+	for (int i=24;i < 36;i++)
+	{
+		str.Format("%d",aValues[i]);
+		parameters->SetItemText(i-24,2,str);
+	}
+	//vacuum
+	for (int i=90;i < 102;i++)
+	{
+		str.Format("%d",aValues[i]);
+		vacuum->SetItemText(i-90,1,str);
+	}
+	break;
+	}
+
+	rErrorMessage=pModbus->ErrorMessage(nError);
+	return nError;
+}
+
+void CModbucfgView::OnChangeEditInterval() 
+{
+
+	CString sText;
+	DWORD dwInterval=0;
+
+	m_edtInterval.GetWindowText(sText);
+	dwInterval=DWORD(atol(sText));
+
+//	if (dwInterval>10000) {
+//		AfxMessageBox("Max. Interval is 10000 ms");
+	if ((dwInterval>10000) || (dwInterval<200)) {
+		AfxMessageBox("Max. is 10000 ms and Min. is 200 ms");
+		dwInterval=10000;
+		sText.Format("%d",dwInterval);
+		m_edtInterval.SetWindowText(sText);
+		return;
+	}
+
+	SetCycleTime(int(dwInterval));	
+}
+
+void CModbucfgView::OnCmdWrite() 
+{
+	BYTE byDevice=0;
+	WORD wValue=0;
+	WORD wAddr=0;
+	CModbus* pModbus=GetConnection();
+	WORD nError=CModbus::ERR_OK;
+	CString strValue;
+	CString sVal;
+	CWaitCursor WaitCursor;
+	double dValue=0.0;
+
+	WORD wQuant, wIndex;
+
+	if (NULL==pModbus) {
+		return;
+	}
+
+	m_edtValue.GetWindowText(strValue);
+	sVal= strValue;
+	wValue = (WORD)atoi(strValue);
+
+	m_edtDevice.GetWindowText(strValue);
+	byDevice = (BYTE)atoi(strValue);
+
+	m_edtWriteAddr.GetWindowText(strValue);
+	wAddr = (WORD)atoi(strValue);
+
+	m_edtQuant2.GetWindowText(strValue);
+	wQuant=(BYTE)(atoi(strValue));
+
+	m_edtIndex.GetWindowText(strValue);
+	wIndex=(BYTE)(atoi(strValue));
+
+	switch (m_cboWriteFunctions.GetCurSel()) {
+		
+	case PRESET_SINGLE_REGISTER:
+
+		switch(m_cboDataType.GetCurSel()) {
+			
+		case DATA_CHAR:
+			sVal.TrimLeft();
+			if (sVal.GetLength()>0) { 
+				nError=pModbus->PresetSingleRegister(byDevice,wAddr,WORD(sVal[0]));
+			}
+			break;
+		case DATA_SIGNED_16:			
+		case DATA_UNSIGNED_16:
+			if (sVal.GetLength()>0) { 
+				nError=pModbus->PresetSingleRegister(byDevice,wAddr,WORD(atoi(sVal)));
+			}
+			break;
+		case DATA_FLOAT:
+			nError=pModbus->PresetSingleRegister(byDevice,wAddr,float(atof(sVal)));
+			break;
+		case DATA_FLOAT_REVERSE:
+			nError=pModbus->PresetSingleRegister(byDevice,wAddr,float(atof(sVal)),CModbus::REAL_REVERSE);
+			break;
+		case DATA_DOUBLE:
+			nError=pModbus->PresetSingleRegister(byDevice,wAddr,double(atof(sVal)));
+		
+			break;
+		case DATA_DOUBLE_REVERSE:
+			nError=pModbus->PresetSingleRegister(byDevice,wAddr,double(atof(sVal)),CModbus::REAL_REVERSE);
+			break;
+		}
+		if(nError!=CModbus::ERR_OK){
+			WaitCursor.Restore();
+			AfxMessageBox(pModbus->ErrorMessage(nError));
+		}
+		break;
+
+	case FORCE_SINGLE_COIL:
+		nError=pModbus->ForceSingleCoil(byDevice,wAddr,(BOOL)wValue);
+		if(nError!=CModbus::ERR_OK){
+			WaitCursor.Restore();  
+			AfxMessageBox(pModbus->ErrorMessage(nError));
+		}
+		break;
+
+	case WRITE_MULTIPLE_REGISTERS:
+		{
+		//controle spin
+		CSpinButtonCtrl* pSpin=(CSpinButtonCtrl*)GetDlgItem(IDC_SPIN2);
+
+		switch(m_cboDataType.GetCurSel()) {			
+		case DATA_CHAR:
+			sVal.TrimLeft();
+			if (sVal.GetLength()>0) { 
+				m_sValueMultiple.SetAt(wIndex,wValue);
+				nError=pModbus->PresetMultipleRegisters(byDevice,wAddr,wQuant,m_sValueMultiple);
+			}
+			break;
+		case DATA_SIGNED_16:
+		case DATA_UNSIGNED_16:
+			if (sVal.GetLength()>0) { 
+				m_wValueMultiple.SetAt(wIndex,wValue);
+				nError=pModbus->PresetMultipleRegisters(byDevice,wAddr,wQuant,m_wValueMultiple);
+			}
+			break;
+		case DATA_FLOAT:
+			m_fValueMultiple.SetAt(wIndex,wValue);
+			nError=pModbus->PresetMultipleRegisters(byDevice,wAddr,wQuant,m_fValueMultiple);
+			break;
+		case DATA_FLOAT_REVERSE:
+			m_fValueMultiple.SetAt(wIndex,wValue);
+			nError=pModbus->PresetMultipleRegisters(byDevice,wAddr,wQuant,m_fValueMultiple,CModbus::REAL_REVERSE);
+			break;
+		case DATA_DOUBLE:
+			m_dValueMultiple.SetAt(wIndex,wValue);
+			nError=pModbus->PresetMultipleRegisters(byDevice,wAddr,wQuant,m_dValueMultiple);
+			break;
+		case DATA_DOUBLE_REVERSE:
+			m_dValueMultiple.SetAt(wIndex,wValue);
+			nError=pModbus->PresetMultipleRegisters(byDevice,wAddr,wQuant,m_dValueMultiple,CModbus::REAL_REVERSE);
+			break;
+		}		
+		if(nError!=CModbus::ERR_OK){
+			WaitCursor.Restore();
+			AfxMessageBox(pModbus->ErrorMessage(nError));
+		}
+		}
+		break;
+
+	case WRITE_MULTIPLE_COILS:
+		{
+		//controle spin
+		CSpinButtonCtrl* pSpin=(CSpinButtonCtrl*)GetDlgItem(IDC_SPIN2);
+//		pSpin->SetRange(0,100);//plage du control : 0-100
+
+		m_bValueMultiple.SetAt(wIndex,((wValue!=0)?1:0));
+
+		nError=pModbus->ForceMultipleCoils(byDevice,wAddr,wQuant,m_bValueMultiple);
+		if(nError!=CModbus::ERR_OK){
+			WaitCursor.Restore();  
+			AfxMessageBox(pModbus->ErrorMessage(nError));
+		}
+		}
+		break;
+		
+	}
+	
+}
+
+CModbus* CModbucfgView::GetConnection()
+{
+
+	int i;
+	CModbus* pModbus=NULL;
+	CConnection* pConnection=NULL;
+	CString sKey;
+
+	i=m_cboConnections.GetCurSel();
+	
+	if (i<0) {
+		ASSERT(FALSE);
+		pModbus=NULL;
+	}
+	else {
+		m_cboConnections.GetLBText(i,sKey);
+		
+		if (gConnections.Lookup(sKey,pConnection)) {
+		
+			pModbus=pConnection->m_pModbus;
+		}
+		else {
+			ASSERT(FALSE);
+			pModbus=NULL;
+		}
+	}
+	
+	return pModbus;
+}
+
+void CModbucfgView::OnCbnSelchangeCboReadFunction()
+{
+	// TODO : ajoutez ici le code de votre gestionnaire de notification de contrôle
+}
+
+void CModbucfgView::OnCbnSelchangeCboWriteFunction()
+{
+	// TODO : ajoutez ici le code de votre gestionnaire de notification de contrôle
+}
+
+
+void CModbucfgView::OnAppMemMap()
+{
+	// TODO : ajoutez ici le code de votre gestionnaire de commande
+	AfxMessageBox(_T("modbus memory map : \n\n -holding registers adr:0x2000 qty:300\n-coils adr:0x3000 qty:100\n-discrete inputs adr:0x1000 qty:4\n-input registers adr:0x4000 qty:4"));
+}
+
+void CModbucfgView::OnEnChangeEditQuant()
+{
+	// TODO :  S'il s'agit d'un contrôle RICHEDIT, le contrôle
+	// n'enverra la notification que si vous substituez la fonction __super::OnInitDialog()
+	// et l'appel CRichEditCtrl().SetEventMask()
+	// par l'indicateur ENM_CHANGE assorti de l'opérateur OR dans le masque.
+
+	// TODO :  Ajoutez ici le code de votre gestionnaire de notification de contrôle
+}
+
+void CModbucfgView::OnEnChangeEditAddr()
+{
+	// TODO :  S'il s'agit d'un contrôle RICHEDIT, le contrôle
+	// n'enverra la notification que si vous substituez la fonction __super::OnInitDialog()
+	// et l'appel CRichEditCtrl().SetEventMask()
+	// par l'indicateur ENM_CHANGE assorti de l'opérateur OR dans le masque.
+
+	// TODO :  Ajoutez ici le code de votre gestionnaire de notification de contrôle
+}
+
+void CModbucfgView::OnEnChangeEditQuant2()
+{
+	// TODO :  S'il s'agit d'un contrôle RICHEDIT, le contrôle
+	// n'enverra la notification que si vous substituez la fonction __super::OnInitDialog()
+	// et l'appel CRichEditCtrl().SetEventMask()
+	// par l'indicateur ENM_CHANGE assorti de l'opérateur OR dans le masque.
+
+	// TODO :  Ajoutez ici le code de votre gestionnaire de notification de contrôle
+}
+
+void CModbucfgView::OnLbnSelchangeList5()
+{
+	// TODO : ajoutez ici le code de votre gestionnaire de notification de contrôle
+}
+
+void CModbucfgView::OnLbnSelchangeLstValues()
+{
+	// TODO : ajoutez ici le code de votre gestionnaire de notification de contrôle
+}
+
+void CModbucfgView::OnEnChangeEditAddrWri()
+{
+	// TODO :  S'il s'agit d'un contrôle RICHEDIT, le contrôle
+	// n'enverra la notification que si vous substituez la fonction __super::OnInitDialog()
+	// et l'appel CRichEditCtrl().SetEventMask()
+	// par l'indicateur ENM_CHANGE assorti de l'opérateur OR dans le masque.
+
+	// TODO :  Ajoutez ici le code de votre gestionnaire de notification de contrôle
+}
+
+void CModbucfgView::OnEnChangeEditValue()
+{
+	// TODO :  S'il s'agit d'un contrôle RICHEDIT, le contrôle
+	// n'enverra la notification que si vous substituez la fonction __super::OnInitDialog()
+	// et l'appel CRichEditCtrl().SetEventMask()
+	// par l'indicateur ENM_CHANGE assorti de l'opérateur OR dans le masque.
+
+	// TODO :  Ajoutez ici le code de votre gestionnaire de notification de contrôle
+}
+
+
+
+void CModbucfgView::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
+{
+	// TODO : ajoutez ici le code de votre gestionnaire de messages et/ou les paramètres par défaut des appels
+
+	if (nSBCode == SB_ENDSCROLL)
+	{
+		return ;//rejeter les messages non validess
+	}
+	//treiter uniquement les messagse de défilement de IDC_SPIN2)
+	if (pScrollBar->GetDlgCtrlID()==IDC_SPIN2)
+	{
+		CString strValue;
+		strValue.Format("%d",(int)nPos);
+		((CSpinButtonCtrl*)pScrollBar)->GetBuddy()->SetWindowText(strValue);
+	}
+
+	__super::OnVScroll(nSBCode, nPos, pScrollBar);
+}
+
+
+void CModbucfgView::OnCmdRead()
+{
+	ldiv_t div_result;
+    float fUpdateSpeed;
+	DWORD dwTime;
+	CString str;
+	WORD nError;
+    
+	int iNumLoops=10;
+	
+	
+	fUpdateSpeed=0.0;
+	
+	if ((m_cboReadFunctions.GetCurSel()>=LOOP_BACK_TEST)&&
+		(m_cboReadFunctions.GetCurSel()<=READ_INPUT_STATUS)){
+		
+		m_dwCount++;
+		nError=ExecuteCmdReadFunction(m_cboReadFunctions.GetCurSel(),dwTime,str);
+		m_dwSum +=dwTime;  
+		
+		div_result = ldiv(m_dwCount,iNumLoops);
+		
+		if (CModbus::ERR_OK!=nError){
+			m_dwErrors++;
+		}
+		
+		if (0==div_result.rem){
+			fUpdateSpeed=(float)(iNumLoops*1000)/(float)m_dwSum;
+			m_dwSum=0; 
+		}
+		else {
+			fUpdateSpeed=(float)(1*1000)/(float)dwTime;
+		}
+
+		m_staError.SetWindowText(str);
+		str.Format("%d Errors=%d  %4.2f(Up./s) ",m_dwCount,m_dwErrors,fUpdateSpeed);  
+		m_statStatus.SetWindowText(str);
+	}
+	
+}
+
+WORD CModbucfgView::ExecuteCmdReadFunction(int iFunction,DWORD& dwTime, CString& rErrorMessage)
+{
+	CModbus* pModbus;
+	CShortArray aValues;
+	CByteArray abCoilValues;
+	
+	CFloatArray afValues;
+	CDblArray adValues;
+
+    CString str;
+	CString sAux;
+    WORD nError;
+	int i;
+	BOOL bRegisters;
+	DWORD dwStart;
+	CString sKey;
+	CConnection* pConnection =NULL;
+	BYTE byDevice;
+	WORD wQuant;
+	WORD wAddr;
+	int nIndex;
+	int nPreviusCount;
+	int iDataType;
+    
+	i=m_cboConnections.GetCurSel();
+
+	iDataType= m_cboDataType.GetCurSel();
+
+	if (i<0) {
+		return 0;
+	}
+	else {
+		m_cboConnections.GetLBText(i,sKey);
+		
+		if (gConnections.Lookup(sKey,pConnection)) {
+		
+			pModbus=pConnection->m_pModbus;
+		}
+		else {
+			ASSERT(FALSE);
+			return 0;
+		}
+	}
+
+	m_edtDevice.GetWindowText(str);
+	
+	byDevice=BYTE(atoi(str));
+
+	m_edtQuant.GetWindowText(str);
+	wQuant=BYTE(atoi(str));
+
+	m_edtReadAddr.GetWindowText(str);
+	wAddr=WORD(atoi(str));
+
+	switch (iFunction) {
+
+	case LOOP_BACK_TEST:
+		dwStart=::timeGetTime();
+		nError=pModbus->LoopbackTest(byDevice);
+		dwTime=::timeGetTime()-dwStart;
+		str="";
+		bRegisters=FALSE;
+		break;
+	
+	case READ_OUTPUT_REGISTERS:	
+		dwStart=::timeGetTime();
+		switch (iDataType) {			
+		case DATA_CHAR:
+		case DATA_SIGNED_16:
+		case DATA_UNSIGNED_16:
+			aValues.SetSize(wQuant);
+			nError=pModbus->ReadOutputRegisters(byDevice,wAddr,wQuant, aValues);
+			break;
+		case DATA_FLOAT:
+			afValues.SetSize(wQuant);
+			nError=pModbus->ReadOutputRegisters(byDevice,wAddr,wQuant, afValues);
+			break;
+		case DATA_FLOAT_REVERSE:
+			afValues.SetSize(wQuant);
+			nError=pModbus->ReadOutputRegisters(byDevice,wAddr,wQuant, afValues,CModbus::REAL_REVERSE);
+			break;
+		case DATA_DOUBLE:
+			adValues.SetSize(wQuant);
+			nError=pModbus->ReadOutputRegisters(byDevice,wAddr,wQuant, adValues);
+			break;
+		case DATA_DOUBLE_REVERSE:
+			adValues.SetSize(wQuant);
+			nError=pModbus->ReadOutputRegisters(byDevice,wAddr,wQuant, adValues,CModbus::REAL_REVERSE);
+			break;
+		}		
+		dwTime=::timeGetTime()-dwStart;
+		bRegisters=TRUE;	
+		break;
+
+		case READ_INPUT_REGISTERS:	
+			dwStart=::timeGetTime();
+			switch (iDataType) {				
+			case DATA_CHAR:
+			case DATA_SIGNED_16:
+			case DATA_UNSIGNED_16:
+				aValues.SetSize(wQuant);
+				nError=pModbus->ReadInputRegisters(byDevice,wAddr,wQuant, aValues);
+				break;
+			case DATA_FLOAT:
+				afValues.SetSize(wQuant);
+				nError=pModbus->ReadInputRegisters(byDevice,wAddr,wQuant, afValues);
+				break;
+			case DATA_FLOAT_REVERSE:
+				afValues.SetSize(wQuant);
+				nError=pModbus->ReadInputRegisters(byDevice,wAddr,wQuant, afValues,CModbus::REAL_REVERSE);
+				break;
+			case DATA_DOUBLE:
+				adValues.SetSize(wQuant);
+				nError=pModbus->ReadInputRegisters(byDevice,wAddr,wQuant, adValues);
+				break;
+			case DATA_DOUBLE_REVERSE:
+				adValues.SetSize(wQuant);
+				nError=pModbus->ReadInputRegisters(byDevice,wAddr,wQuant, adValues,CModbus::REAL_REVERSE);
+				break;
+			}
+			dwTime=::timeGetTime()-dwStart;
+			bRegisters=TRUE;
+			break;
+			
+		case READ_OUTPUT_STATUS:
+			dwStart=::timeGetTime();
+			abCoilValues.SetSize(wQuant);
+			nError=pModbus->ReadOutputStatus(byDevice,wAddr,wQuant, abCoilValues);
+			dwTime=::timeGetTime()-dwStart;
+			bRegisters=FALSE;
+			break;
+				
+		case READ_INPUT_STATUS:
+			dwStart=::timeGetTime();
+			abCoilValues.SetSize(wQuant);
+			nError=pModbus->ReadInputStatus(byDevice,wAddr,wQuant, abCoilValues); 
+			dwTime=::timeGetTime()-dwStart;
+			bRegisters=FALSE;
+			break;
+	}
+
+	nIndex=m_lstValues.GetCurSel();
+	nPreviusCount=m_lstValues.GetCount();
+
+	m_lstValues.SetRedraw(FALSE);
+	
+	if (bRegisters) {
+		for(i=0;i<wQuant;++i) {
+			switch (iDataType) {
+			case DATA_CHAR:
+				sAux.Format("[%u]=%c 0x%x",wAddr+i,(char)aValues[i],(WORD)aValues[i]);
+			    break;
+            case DATA_SIGNED_16:
+				sAux.Format("[%u]=%d 0x%x",wAddr+i,aValues[i],(WORD)aValues[i]);
+				break;
+			case DATA_UNSIGNED_16:
+				sAux.Format("[%u]=%d 0x%x",wAddr+i,(WORD)aValues[i],(WORD)aValues[i]);
+				break;
+            case DATA_FLOAT:
+			case DATA_FLOAT_REVERSE:
+				sAux.Format("[%u]=%g ",wAddr+2*i,afValues[i]);
+				break;
+			case DATA_DOUBLE:
+			case DATA_DOUBLE_REVERSE:
+				sAux.Format("[%u]=%g ",wAddr+4*i,adValues[i]);
+				break;
+			}			
+			//sAux.Format("[%u]=%d  %d  0x%x  ",wAddr+i,aValues[i],(WORD)aValues[i],(WORD)aValues[i]);
+			m_lstValues.DeleteString(i);
+			m_lstValues.InsertString(i,sAux);
+		}
+	}
+	else {		
+		for(i=0;i<abCoilValues.GetSize();++i) {
+			sAux.Format("[%u]=%d ",wAddr+i,abCoilValues[i]);
+			m_lstValues.DeleteString(i);
+			m_lstValues.InsertString(i,sAux);
+		}
+	}
+
+	if (nPreviusCount>wQuant) {
+		for (i=wQuant;i<nPreviusCount;i++){
+			m_lstValues.DeleteString(wQuant);
+		}
+	}
+	
+	if ((nIndex>0)&&(nIndex<m_lstValues.GetCount())) {
+		m_lstValues.SetCurSel(nIndex);
+	}
+
+	m_lstValues.SetRedraw(TRUE);
+	m_lstValues.Invalidate(FALSE);
+		
+	rErrorMessage=pModbus->ErrorMessage(nError);
+	return nError;
+}
+
+void CModbucfgView::OnEnChangeEdit16()
+{
+	BYTE byDevice=0;
+	WORD wAddr=2023;
+	CModbus* pModbus=GetConnection();
+	WORD nError=CModbus::ERR_OK;
+	CString str, sVal;
+	CWaitCursor WaitCursor;
+
+	if (pModbus==NULL)
+		return;
+
+	m_edtDevice.GetWindowText(str);
+	byDevice = (BYTE)atoi(str);
+
+	GetDlgItem(IDC_EDIT16)->GetWindowText(sVal);
+	AfxMessageBox("CModbucfgView::OnEnChangeEdit16()");	
+	//case DATA_FLOAT:
+	nError=pModbus->PresetSingleRegister(byDevice,wAddr,float(atof(sVal)));
+	if(nError!=CModbus::ERR_OK){
+		WaitCursor.Restore();  
+		AfxMessageBox(pModbus->ErrorMessage(nError));
+	}
+}
+
+void CModbucfgView::OnBnClickedButton1()
+{
+	CString OpenFilter;
+	OpenFilter = "Text File (*.txt)|*.txt||";
+
+	//créer l'instance avec le constructeur
+	CFileDialog FileOpenDialog(
+		TRUE,//ouverture de la boite de dialogue
+		NULL,
+		NULL,
+		OFN_FILEMUSTEXIST|OFN_HIDEREADONLY|OFN_PATHMUSTEXIST,
+		OpenFilter, // filtre
+		AfxGetMainWnd()); // la fenetre parent
+
+	if(FileOpenDialog.DoModal()==IDOK)//affichage
+	{// ouverture de fichier avec la structure suivante :
+		//SVil Sleil STc Nbal_max Fr N_cur N_Seqcond Num_C(8x)
+		unsigned int wTmpBuf;
+		float fTmpBuf;
+		CWordArray writeParamInit_120;
+		CFloatArray writeParamInit_121;
+		writeParamInit_120.SetSize(100);//pr les adresses modbus
+		writeParamInit_121.SetSize(100);
+		CString str;
+		FILE* pFile = fopen (FileOpenDialog.GetPathName(), "r");	
+		if(pFile == NULL)		
+			return;	
+		/* ptr au debut du fichier*/
+		fseek( pFile, 0L, SEEK_SET );
+		/* lecture a artir du fichier*/
+		fscanf(pFile,"%d ",&wTmpBuf);
+		writeParamInit_120.SetAtGrow(0,wTmpBuf);//SVil
+		fscanf(pFile,"%f ",&fTmpBuf);
+		writeParamInit_121.SetAtGrow(0,fTmpBuf);//Sleil
+		fscanf(pFile,"%f ",&fTmpBuf);
+		writeParamInit_121.SetAtGrow(1,fTmpBuf);//STc
+		for (int i=3;i<14;i++){//nb de mots ds le fichier
+			fscanf(pFile,"%d ",&wTmpBuf);
+			if (i<5)
+				writeParamInit_120.SetAtGrow(i+2,wTmpBuf);//Nbal_max/Fr
+			else if (i==5)
+				writeParamInit_120.SetAtGrow(i+22,wTmpBuf);//NSeq_cond
+			else if (i>5)
+				writeParamInit_120.SetAtGrow(i+24,wTmpBuf);//8xNum_C
+		}
+		fclose(pFile);
+
+		str.Format("SVil=%d, Sleil=%f NSeqcond=%d",writeParamInit_120[0],writeParamInit_121[0],writeParamInit_120[27]);
+		AfxMessageBox(str);
+
+		//copie des buffers
+		m_wValueMultiple.Copy( writeParamInit_120 );
+		m_fValueMultiple.Copy( writeParamInit_121 );
+	}
+}
+
+void CModbucfgView::OnBnClickedButton2()
+{
+	BYTE byDevice=0;
+	WORD wAddr=0;
+	CString strValue;
+	CWaitCursor WaitCursor;
+
+	WORD wQuant;
+
+	m_edtDevice.GetWindowText(strValue);
+	byDevice = (BYTE)atoi(strValue);
+
+//	case DATA_UNSIGNED_16:
+	CModbus* pModbus=GetConnection();
+	WORD nError=CModbus::ERR_OK;
+	if (NULL==pModbus) {
+		return;
+	}
+	wAddr = 2020;
+	wQuant=38;
+	nError=pModbus->PresetMultipleRegisters(byDevice,wAddr,wQuant,m_wValueMultiple);
+
+//	case DATA_FLOAT:
+	pModbus=GetConnection();
+	if (NULL==pModbus) {
+		return;
+	}
+	wAddr = 2021;
+	wQuant=2;
+	nError=pModbus->PresetMultipleRegisters(byDevice,wAddr,wQuant,m_fValueMultiple);
+	
+	if(nError!=CModbus::ERR_OK){
+		WaitCursor.Restore();
+		AfxMessageBox(pModbus->ErrorMessage(nError));
+	}		
+}
Index: trunk/ModbucfgView.h
===================================================================
--- trunk/ModbucfgView.h	(revision 10)
+++ trunk/ModbucfgView.h	(revision 10)
@@ -0,0 +1,218 @@
+// ModbucfgView.h : interface of the CModbucfgView class
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#if !defined(AFX_MODBUCFGVIEW_H__A3BAD4B5_F5AE_11D1_8FE9_6CD504C1BC01__INCLUDED_)
+#define AFX_MODBUCFGVIEW_H__A3BAD4B5_F5AE_11D1_8FE9_6CD504C1BC01__INCLUDED_
+
+#if _MSC_VER >= 1000
+#pragma once
+#endif // _MSC_VER >= 1000
+
+
+#include "Globals.h"
+#include "ThinThread.h"
+#include "afxwin.h"
+
+class CModbucfgView : public CFormView,public CThinThread
+{
+protected: // create from serialization only
+	CModbucfgView();
+	DECLARE_DYNCREATE(CModbucfgView)
+
+public:
+	//{{AFX_DATA(CModbucfgView)
+	enum { IDD = IDD_MODBUCFG_FORM };
+	CComboBox	m_cboDataType;
+	CEdit	m_edtInterval;
+	CButton	m_butPollEnable;
+	CStatic	m_statStatus;
+	CStatic	m_staError;
+	CListBox	m_lstValues;
+	CComboBox	m_cboWriteFunctions;
+	CComboBox	m_cboReadFunctions;
+	CComboBox	m_cboConnections;
+	CEdit	m_edtValue;
+	CEdit	m_edtQuant;
+	CEdit	m_edtDevice;
+	CEdit	m_edtWriteAddr;
+	CEdit	m_edtReadAddr;
+	CButton	m_cmdWrite;
+	//}}AFX_DATA
+
+// Attributes
+public:
+	CModbucfgDoc* GetDocument();
+
+	enum _Modbus_Functions_ {
+	 LOOP_BACK_TEST=0,
+	 READ_OUTPUT_REGISTERS=1,
+	 READ_INPUT_REGISTERS=2,
+	 READ_OUTPUT_STATUS=3,
+	 READ_INPUT_STATUS=4,
+	 PRESET_SINGLE_REGISTER=0,
+	 FORCE_SINGLE_COIL=1,
+	 WRITE_MULTIPLE_REGISTERS=2,
+	 WRITE_MULTIPLE_COILS=3
+	};
+
+	enum _Data_Types_ {
+		DATA_CHAR =0 , 
+        DATA_SIGNED_16=1,
+		DATA_UNSIGNED_16=2,
+		DATA_FLOAT=3,
+		DATA_FLOAT_REVERSE=4,
+		DATA_DOUBLE=5,
+		DATA_DOUBLE_REVERSE=6,
+	};
+
+// Operations
+public:
+
+// Overrides
+	// ClassWizard generated virtual function overrides
+	//{{AFX_VIRTUAL(CModbucfgView)
+	public:
+	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
+	virtual void OnInitialUpdate();
+	protected:
+	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
+	//}}AFX_VIRTUAL
+
+// Implementation
+public:
+	void EndWork();
+	virtual ~CModbucfgView();
+#ifdef _DEBUG
+	virtual void AssertValid() const;
+	virtual void Dump(CDumpContext& dc) const;
+#endif
+
+protected:
+
+// Generated message map functions
+protected:
+	CModbus* GetConnection();
+	WORD ExecuteReadFunction(int iFunction,DWORD& dwTime , CString& rErrorMessage);
+	WORD ExecuteCmdReadFunction(int iFunction,DWORD& dwTime , CString& rErrorMessage);
+	void DoWork();
+	void StartWork();
+	void LoadControls();
+	//{{AFX_MSG(CModbucfgView)
+	afx_msg void OnchkEnablePoll();
+	afx_msg void OnChangeEditInterval();
+	afx_msg void OnCmdWrite();
+	//}}AFX_MSG
+	DECLARE_MESSAGE_MAP()
+
+private:
+	DWORD m_dwSum; //thread vars 
+    DWORD m_dwCount; 
+	DWORD m_dwErrors;
+
+public:
+	afx_msg void OnCbnSelchangeCboReadFunction();
+	afx_msg void OnCbnSelchangeCboWriteFunction();
+
+	afx_msg void OnAppMemMap();
+	afx_msg void OnEnChangeEditQuant();
+	afx_msg void OnEnChangeEditAddr();
+	afx_msg void OnEnChangeEditQuant2();
+	CEdit m_edtQuant2;
+	afx_msg void OnLbnSelchangeList5();
+	afx_msg void OnLbnSelchangeLstValues();
+//	CListBox m_list5Values;
+	afx_msg void OnEnChangeEditAddrWri();
+	afx_msg void OnEnChangeEditValue();
+	CEdit m_edtIndex;
+	int m_spinIndex;
+	afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
+
+	//tableaux pour les write multiple
+	CByteArray m_bValueMultiple;
+	CShortArray m_sValueMultiple;
+	CWordArray m_wValueMultiple;
+	CFloatArray m_fValueMultiple;
+	CDblArray m_dValueMultiple;
+	CEdit m_readEil;
+	CEdit m_readSVd;
+	CEdit m_readSVfin;
+	CEdit m_readSV1;
+	CEdit m_readSV2;
+	CEdit m_readdtp;
+	CEdit m_readdt;
+	CEdit m_readdP;
+	CEdit m_readdPsecu;
+	afx_msg void OnEnChangeEdit10();
+	CEdit m_readSVil;
+	CEdit m_readSleil;
+	CEdit m_readSTc;
+	CEdit m_readNbal_max;
+	CEdit m_readFr;
+	CEdit m_readN_cur;
+	CButton m_cmdRead;
+	afx_msg void OnCmdRead();
+	CEdit m_readNil;
+	CEdit m_readNil_stat;
+	CEdit m_readP_last;
+	CEdit m_readN_last;
+	CEdit m_readdPil;
+	CEdit m_readV_cur;
+	CEdit m_readPic;
+	CEdit m_readTimer;
+	CEdit m_readNbal;
+	CEdit m_readP_cde;
+	CEdit m_readPp;
+	CEdit m_readStat_C_1;
+	CEdit m_readStat_C_2;
+	CEdit m_readStat_C_3;
+	CEdit m_readStat_C_4;
+	CEdit m_readStat_C_5;
+	CEdit m_readStat_C_6;
+	CEdit m_readStat_C_7;
+	CEdit m_readStat_C_8;
+	CEdit m_readNum_C1a;
+	CEdit m_readNum_C1b;
+	CEdit m_readNum_C2a;
+	CEdit m_readNum_C2b;
+	CEdit m_readNum_C3a;
+	CEdit m_readNum_C3b;
+	CEdit m_readNum_C4a;
+	CEdit m_readNum_C4b;
+	CEdit m_readN_Seqcond;
+	CEdit m_readMAP;
+	CEdit m_readTemp_cond_1;
+	CEdit m_readTemp_cond_2;
+	CEdit m_readTemp_cond_3;
+	CEdit m_readTemp_cond_4;
+	CEdit m_readTemp_cond_5;
+	CEdit m_readTemp_cond_6;
+	CEdit m_readTemp_cond_7;
+	CEdit m_readTemp_cond_8;
+
+	CListCtrl* m_readVacuum;
+	CListCtrl* m_readCondParam;
+	afx_msg void OnEnChangeEdit16();
+	CEdit m_readStat_C_9;
+	CEdit m_readStat_C_10;
+	CEdit m_readStat_C_11;
+	CEdit m_readStat_C_12;
+	CEdit m_readTemp_cond_9;
+	CEdit m_readTemp_cond_10;
+	CEdit m_readTemp_cond_11;
+	CEdit m_readTemp_cond_12;
+	afx_msg void OnBnClickedButton1();
+	afx_msg void OnBnClickedButton2();
+};
+
+#ifndef _DEBUG  // debug version in ModbucfgView.cpp
+inline CModbucfgDoc* CModbucfgView::GetDocument()
+   { return (CModbucfgDoc*)m_pDocument; }
+#endif
+
+/////////////////////////////////////////////////////////////////////////////
+
+//{{AFX_INSERT_LOCATION}}
+// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
+
+#endif // !defined(AFX_MODBUCFGVIEW_H__A3BAD4B5_F5AE_11D1_8FE9_6CD504C1BC01__INCLUDED_)
Index: trunk/Modifications.txt
===================================================================
--- trunk/Modifications.txt	(revision 10)
+++ trunk/Modifications.txt	(revision 10)
@@ -0,0 +1,64 @@
+stdafx.h file 
+
+// stdafx.h : include file for standard system include files,
+//  or project specific include files that are used frequently, but
+//      are changed infrequently
+//
+
+#if !defined(AFX_STDAFX_H__A3BAD4AD_F5AE_11D1_8FE9_6CD504C1BC01__INCLUDED_)
+#define AFX_STDAFX_H__A3BAD4AD_F5AE_11D1_8FE9_6CD504C1BC01__INCLUDED_
+
+#if _MSC_VER >= 1000
+#pragma once
+#endif // _MSC_VER >= 1000
+
+#define VC_EXTRALEAN		// Exclude rarely-used stuff from Windows headers
+
+
+#define _WIN32_WINNT 0x0400 
+
+#include <afxwin.h>         // MFC core and standard components
+#include <afxext.h>         // MFC extensions
+#include <afxdisp.h>        // MFC OLE automation classes
+#ifndef _AFX_NO_AFXCMN_SUPPORT
+#include <afxcmn.h>			// MFC support for Windows Common Controls
+#endif // _AFX_NO_AFXCMN_SUPPORT
+
+#include <afxsock.h>		// MFC socket extensions
+
+
+//declaration files for ATL base classes
+#include <atlbase.h>  
+//external linkage for CComModule
+extern CComModule _Module;
+//ActiveX Template Library include
+#include <atlcom.h>
+
+//{{AFX_INSERT_LOCATION}}
+// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
+
+#endif // !defined(AFX_STDAFX_H__A3BAD4AD_F5AE_11D1_8FE9_6CD504C1BC01__INCLUDED_)
+
+// stdafx.cpp : source file that includes just the standard includes
+//	Modbucfg.pch will be the pre-compiled header
+//	stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+#include <atlimpl.cpp> 
+
+
+XXXApp.cpp file 
+
+CComModule _Module;
+
+
+
+add files to project 
+
+AutoModbus.cpp 
+modbus.cpp  
+OleSafeArray.cpp
+Performancecouter.cpp
+crc16.cpp
+
+
Index: trunk/ReadMe.txt
===================================================================
--- trunk/ReadMe.txt	(revision 10)
+++ trunk/ReadMe.txt	(revision 10)
@@ -0,0 +1,112 @@
+========================================================================
+       MICROSOFT FOUNDATION CLASS LIBRARY : Modbucfg
+========================================================================
+
+
+AppWizard has created this Modbucfg application for you.  This application
+not only demonstrates the basics of using the Microsoft Foundation classes
+but is also a starting point for writing your application.
+
+This file contains a summary of what you will find in each of the files that
+make up your Modbucfg application.
+
+Modbucfg.h
+    This is the main header file for the application.  It includes other
+    project specific headers (including Resource.h) and declares the
+    CModbucfgApp application class.
+
+Modbucfg.cpp
+    This is the main application source file that contains the application
+    class CModbucfgApp.
+
+Modbucfg.rc
+    This is a listing of all of the Microsoft Windows resources that the
+    program uses.  It includes the icons, bitmaps, and cursors that are stored
+    in the RES subdirectory.  This file can be directly edited in Microsoft
+	Developer Studio.
+
+res\Modbucfg.ico
+    This is an icon file, which is used as the application's icon.  This
+    icon is included by the main resource file Modbucfg.rc.
+
+res\Modbucfg.rc2
+    This file contains resources that are not edited by Microsoft 
+	Developer Studio.  You should place all resources not
+	editable by the resource editor in this file.
+
+Modbucfg.reg
+    This is an example .REG file that shows you the kind of registration
+    settings the framework will set for you.  You can use this as a .REG
+    file to go along with your application or just delete it and rely
+    on the default RegisterShellFileTypes registration.
+
+Modbucfg.odl
+    This file contains the Object Description Language source code for the
+    type library of your application.
+
+Modbucfg.clw
+    This file contains information used by ClassWizard to edit existing
+    classes or add new classes.  ClassWizard also uses this file to store
+    information needed to create and edit message maps and dialog data
+    maps and to create prototype member functions.
+
+/////////////////////////////////////////////////////////////////////////////
+
+For the main frame window:
+
+MainFrm.h, MainFrm.cpp
+    These files contain the frame class CMainFrame, which is derived from
+    CMDIFrameWnd and controls all MDI frame features.
+
+res\Toolbar.bmp
+    This bitmap file is used to create tiled images for the toolbar.
+    The initial toolbar and status bar are constructed in the
+    CMainFrame class.  Edit this toolbar bitmap along with the
+    array in MainFrm.cpp to add more toolbar buttons.
+
+/////////////////////////////////////////////////////////////////////////////
+
+AppWizard creates one document type and one view:
+
+ModbucfgDoc.h, ModbucfgDoc.cpp - the document
+    These files contain your CModbucfgDoc class.  Edit these files to
+    add your special document data and to implement file saving and loading
+    (via CModbucfgDoc::Serialize).
+
+ModbucfgView.h, ModbucfgView.cpp - the view of the document
+    These files contain your CModbucfgView class.
+    CModbucfgView objects are used to view CModbucfgDoc objects.
+
+res\ModbucfgDoc.ico
+    This is an icon file, which is used as the icon for MDI child windows
+    for the CModbucfgDoc class.  This icon is included by the main
+    resource file Modbucfg.rc.
+
+
+/////////////////////////////////////////////////////////////////////////////
+Other standard files:
+
+StdAfx.h, StdAfx.cpp
+    These files are used to build a precompiled header (PCH) file
+    named Modbucfg.pch and a precompiled types file named StdAfx.obj.
+
+Resource.h
+    This is the standard header file, which defines new resource IDs.
+    Microsoft Developer Studio reads and updates this file.
+
+/////////////////////////////////////////////////////////////////////////////
+Other notes:
+
+AppWizard uses "TODO:" to indicate parts of the source code you
+should add to or customize.
+
+If your application uses MFC in a shared DLL, and your application is 
+in a language other than the operating system's current language, you
+will need to copy the corresponding localized resources MFC40XXX.DLL
+from the Microsoft Visual C++ CD-ROM onto the system or system32 directory,
+and rename it to be MFCLOC.DLL.  ("XXX" stands for the language abbreviation.
+For example, MFC40DEU.DLL contains resources translated to German.)  If you
+don't do this, some of the UI elements of your application will remain in the
+language of the operating system.
+
+/////////////////////////////////////////////////////////////////////////////
Index: trunk/Release/BuildLog.htm
===================================================================
--- trunk/Release/BuildLog.htm	(revision 10)
+++ trunk/Release/BuildLog.htm	(revision 10)
@@ -0,0 +1,90 @@
+<html>
+<head>
+<META HTTP-EQUIV="Content-Type" content="text/html; charset=Windows-1252">
+</head>
+<body>
+<pre>
+<table width=100% bgcolor=#CFCFE5><tr> <td> <font face=arial size=+3>
+Journal de génération
+</font></table><table width=* cellspacing=0 cellpadding=0><tr><td width=0 bgcolor=#EDEDF5>&nbsp;</td><td width=0 bgcolor=#FFFFFF>&nbsp;</td><td width=*><pre>
+<h3>------- Génération démarrée : Projet : Modbucfg, Configuration : Release|Win32 -------
+</h3>
+</pre></table><table width=100% bgcolor=#DFDFE5><tr><td><font face=arial size=+2>
+Lignes de commande
+</font></table><table width=* cellspacing=0 cellpadding=0><tr><td width=0 bgcolor=#EDEDF5>&nbsp;</td><td width=0 bgcolor=#FFFFFF>&nbsp;</td><td width=*><pre>Création du fichier temporaire "c:\Documents and Settings\Administrateur\Mes documents\xfel\xsuc\Release\RSP000020.rsp" avec pour contenu
+[
+/O2 /I "C:\Documents and Settings\Administrateur\Mes documents\xfel\downloads\modsrc02\utilclasses\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /FD /EHsc /MD /Yc"stdafx.h" /Fp".\Release/Modbucfg.pch" /Fo".\Release/" /Fd".\Release/" /W3 /c
+".\StdAfx.cpp"
+]
+Création de la ligne de commande "cl.exe @"c:\Documents and Settings\Administrateur\Mes documents\xfel\xsuc\Release\RSP000020.rsp" /nologo"
+Création du fichier temporaire "c:\Documents and Settings\Administrateur\Mes documents\xfel\xsuc\Release\RSP000021.rsp" avec pour contenu
+[
+/O2 /I "C:\Documents and Settings\Administrateur\Mes documents\xfel\downloads\modsrc02\utilclasses\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /FD /EHsc /MD /Yu"stdafx.h" /Fp".\Release/Modbucfg.pch" /Fo".\Release/" /Fd".\Release/" /W3 /c
+".\Splash.cpp"
+".\ModbucfgView.cpp"
+".\ModbucfgDoc.cpp"
+".\Modbucfg.cpp"
+".\MainFrm.cpp"
+".\Globals.cpp"
+".\DlgRemoteParameters.cpp"
+".\DlgConnections.cpp"
+".\Connections.cpp"
+".\Connection.cpp"
+".\CommParameters.cpp"
+".\ChildFrm.cpp"
+]
+Création de la ligne de commande "cl.exe @"c:\Documents and Settings\Administrateur\Mes documents\xfel\xsuc\Release\RSP000021.rsp" /nologo"
+Création de la ligne de commande "rc.exe /d "NDEBUG" /d "_AFXDLL" /l 0x416 /fo".\Release/Modbucfg.res" ".\Modbucfg.rc""
+Création du fichier temporaire "c:\Documents and Settings\Administrateur\Mes documents\xfel\xsuc\Release\RSP000022.rsp" avec pour contenu
+[
+/OUT:".\Release/csxfel.exe" /INCREMENTAL:NO /NOLOGO /LIBPATH:"C:\Documents and Settings\Administrateur\Mes documents\xfel\downloads\modsrc02\ModbuLib" /PDB:".\Release/Modbucfg.pdb" /SUBSYSTEM:WINDOWS /MACHINE:X86 winmm.lib
+".\Release\ChildFrm.obj"
+".\Release\CommParameters.obj"
+".\Release\Connection.obj"
+".\Release\Connections.obj"
+".\Release\DlgConnections.obj"
+".\Release\DlgRemoteParameters.obj"
+".\Release\Globals.obj"
+".\Release\MainFrm.obj"
+".\Release\Modbucfg.obj"
+".\Release\Modbucfg.res"
+".\Release\ModbucfgDoc.obj"
+".\Release\ModbucfgView.obj"
+".\Release\Splash.obj"
+".\Release\StdAfx.obj"
+]
+Création de la ligne de commande "link.exe @"c:\Documents and Settings\Administrateur\Mes documents\xfel\xsuc\Release\RSP000022.rsp""
+</pre></table><table width=100% bgcolor=#DFDFE5><tr><td><font face=arial size=+2>
+Fenêtre Sortie
+</font></table><table width=* cellspacing=0 cellpadding=0><tr><td width=0 bgcolor=#EDEDF5>&nbsp;</td><td width=0 bgcolor=#FFFFFF>&nbsp;</td><td width=*><pre>Compilation...
+StdAfx.cpp
+atlimpl.cpp is obsolete. Please remove it from your project.
+Compilation...
+Splash.cpp
+ModbucfgView.cpp
+ModbucfgView.cpp(429) : warning C4101: 'dwStart' : variable locale non référencée
+ModbucfgView.cpp(436) : warning C4101: 'nPreviusCount' : variable locale non référencée
+ModbucfgView.cpp(428) : warning C4101: 'bRegisters' : variable locale non référencée
+ModbucfgView.cpp(437) : warning C4101: 'iDataType' : variable locale non référencée
+ModbucfgView.cpp(435) : warning C4101: 'nIndex' : variable locale non référencée
+ModbucfgDoc.cpp
+Modbucfg.cpp
+Modbucfg.cpp(88) : warning C4996: 'CWinApp::Enable3dControls' a été déclaré désapprouvé
+        C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afxwin.h(4369) : voir la déclaration de 'CWinApp::Enable3dControls'
+MainFrm.cpp
+Globals.cpp
+DlgRemoteParameters.cpp
+DlgConnections.cpp
+Connections.cpp
+Connection.cpp
+CommParameters.cpp
+ChildFrm.cpp
+Génération de code en cours...
+Compilation des ressources en cours...
+Édition des liens en cours...
+</pre></table><table width=100% bgcolor=#DFDFE5><tr><td><font face=arial size=+2>
+Résultats
+</font></table><table width=* cellspacing=0 cellpadding=0><tr><td width=0 bgcolor=#EDEDF5>&nbsp;</td><td width=0 bgcolor=#FFFFFF>&nbsp;</td><td width=*><pre>
+Le journal de génération a été enregistré à l'emplacement "file://c:\Documents and Settings\Administrateur\Mes documents\xfel\xsuc\Release\BuildLog.htm"
+Modbucfg - 0 erreur(s), 6 avertissement(s)</pre></table><table   width=100% height=20 bgcolor=#CFCFE5><tr><td><font face=arial size=+2>
+</font></table></body></html>
Index: trunk/Splash.cpp
===================================================================
--- trunk/Splash.cpp	(revision 10)
+++ trunk/Splash.cpp	(revision 10)
@@ -0,0 +1,141 @@
+// CG: This file was added by the Splash Screen component.
+// Splash.cpp : implementation file
+//
+
+#include "stdafx.h"  // e. g. stdafx.h
+#include "resource.h"  // e.g. resource.h
+
+#include "Splash.h"  // e.g. splash.h
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char BASED_CODE THIS_FILE[] = __FILE__;
+#endif
+
+/////////////////////////////////////////////////////////////////////////////
+//   Splash Screen class
+
+BOOL CSplashWnd::c_bShowSplashWnd;
+CSplashWnd* CSplashWnd::c_pSplashWnd;
+CSplashWnd::CSplashWnd()
+{
+}
+
+CSplashWnd::~CSplashWnd()
+{
+	// Clear the static window pointer.
+	ASSERT(c_pSplashWnd == this);
+	c_pSplashWnd = NULL;
+}
+
+BEGIN_MESSAGE_MAP(CSplashWnd, CWnd)
+	//{{AFX_MSG_MAP(CSplashWnd)
+	ON_WM_CREATE()
+	ON_WM_PAINT()
+	ON_WM_TIMER()
+	//}}AFX_MSG_MAP
+END_MESSAGE_MAP()
+
+void CSplashWnd::EnableSplashScreen(BOOL bEnable /*= TRUE*/)
+{
+	c_bShowSplashWnd = bEnable;
+}
+
+void CSplashWnd::ShowSplashScreen(CWnd* pParentWnd /*= NULL*/)
+{
+	if (!c_bShowSplashWnd || c_pSplashWnd != NULL)
+		return;
+
+	// Allocate a new splash screen, and create the window.
+	c_pSplashWnd = new CSplashWnd;
+	if (!c_pSplashWnd->Create(pParentWnd))
+		delete c_pSplashWnd;
+	else
+		c_pSplashWnd->UpdateWindow();
+}
+
+BOOL CSplashWnd::PreTranslateAppMessage(MSG* pMsg)
+{
+	if (c_pSplashWnd == NULL)
+		return FALSE;
+
+	// If we get a keyboard or mouse message, hide the splash screen.
+	if (pMsg->message == WM_KEYDOWN ||
+	    pMsg->message == WM_SYSKEYDOWN ||
+	    pMsg->message == WM_LBUTTONDOWN ||
+	    pMsg->message == WM_RBUTTONDOWN ||
+	    pMsg->message == WM_MBUTTONDOWN ||
+	    pMsg->message == WM_NCLBUTTONDOWN ||
+	    pMsg->message == WM_NCRBUTTONDOWN ||
+	    pMsg->message == WM_NCMBUTTONDOWN)
+	{
+		c_pSplashWnd->HideSplashScreen();
+		return TRUE;	// message handled here
+	}
+
+	return FALSE;	// message not handled
+}
+
+BOOL CSplashWnd::Create(CWnd* pParentWnd /*= NULL*/)
+{
+	if (!m_bitmap.LoadBitmap(IDB_SPLASH))
+		return FALSE;
+
+	BITMAP bm;
+	m_bitmap.GetBitmap(&bm);
+
+	return CreateEx(0,
+		AfxRegisterWndClass(0, AfxGetApp()->LoadStandardCursor(IDC_ARROW)),
+		NULL, WS_POPUP | WS_VISIBLE, 0, 0, bm.bmWidth, bm.bmHeight, pParentWnd->GetSafeHwnd(), NULL);
+}
+
+void CSplashWnd::HideSplashScreen()
+{
+	// Destroy the window, and update the mainframe.
+	DestroyWindow();
+	AfxGetMainWnd()->UpdateWindow();
+}
+
+void CSplashWnd::PostNcDestroy()
+{
+	// Free the C++ class.
+	delete this;
+}
+
+int CSplashWnd::OnCreate(LPCREATESTRUCT lpCreateStruct)
+{
+	if (CWnd::OnCreate(lpCreateStruct) == -1)
+		return -1;
+
+	// Center the window.
+	CenterWindow();
+
+	// Set a timer to destroy the splash screen.
+	SetTimer(1, 3000, NULL);
+
+	return 0;
+}
+
+void CSplashWnd::OnPaint()
+{
+	CPaintDC dc(this);
+
+	CDC dcImage;
+	if (!dcImage.CreateCompatibleDC(&dc))
+		return;
+
+	BITMAP bm;
+	m_bitmap.GetBitmap(&bm);
+
+	// Paint the image.
+	CBitmap* pOldBitmap = dcImage.SelectObject(&m_bitmap);
+	dc.BitBlt(0, 0, bm.bmWidth, bm.bmHeight, &dcImage, 0, 0, SRCCOPY);
+	dcImage.SelectObject(pOldBitmap);
+}
+
+void CSplashWnd::OnTimer(UINT nIDEvent)
+{
+	// Destroy the splash screen window.
+	HideSplashScreen();
+}
Index: trunk/Splash.h
===================================================================
--- trunk/Splash.h	(revision 10)
+++ trunk/Splash.h	(revision 10)
@@ -0,0 +1,55 @@
+// CG: This file was added by the Splash Screen component.
+
+#ifndef _SPLASH_SCRN_
+#define _SPLASH_SCRN_
+
+// Splash.h : header file
+//
+
+/////////////////////////////////////////////////////////////////////////////
+//   Splash Screen class
+
+class CSplashWnd : public CWnd
+{
+// Construction
+protected:
+	CSplashWnd();
+
+// Attributes:
+public:
+	CBitmap m_bitmap;
+
+// Operations
+public:
+	static void EnableSplashScreen(BOOL bEnable = TRUE);
+	static void ShowSplashScreen(CWnd* pParentWnd = NULL);
+	static BOOL PreTranslateAppMessage(MSG* pMsg);
+
+// Overrides
+	// ClassWizard generated virtual function overrides
+	//{{AFX_VIRTUAL(CSplashWnd)
+	//}}AFX_VIRTUAL
+
+// Implementation
+public:
+	~CSplashWnd();
+	virtual void PostNcDestroy();
+
+protected:
+	BOOL Create(CWnd* pParentWnd = NULL);
+	void HideSplashScreen();
+	static BOOL c_bShowSplashWnd;
+	static CSplashWnd* c_pSplashWnd;
+
+// Generated message map functions
+protected:
+	//{{AFX_MSG(CSplashWnd)
+	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
+	afx_msg void OnPaint();
+	afx_msg void OnTimer(UINT nIDEvent);
+	//}}AFX_MSG
+	DECLARE_MESSAGE_MAP()
+};
+
+
+#endif
Index: trunk/StdAfx.cpp
===================================================================
--- trunk/StdAfx.cpp	(revision 10)
+++ trunk/StdAfx.cpp	(revision 10)
@@ -0,0 +1,7 @@
+// stdafx.cpp : source file that includes just the standard includes
+//	Modbucfg.pch will be the pre-compiled header
+//	stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+#include <atlimpl.cpp> 
+
Index: trunk/StdAfx.h
===================================================================
--- trunk/StdAfx.h	(revision 10)
+++ trunk/StdAfx.h	(revision 10)
@@ -0,0 +1,31 @@
+// stdafx.h : include file for standard system include files,
+//  or project specific include files that are used frequently, but
+//      are changed infrequently
+//
+
+#if !defined(AFX_STDAFX_H__A3BAD4AD_F5AE_11D1_8FE9_6CD504C1BC01__INCLUDED_)
+#define AFX_STDAFX_H__A3BAD4AD_F5AE_11D1_8FE9_6CD504C1BC01__INCLUDED_
+
+#if _MSC_VER >= 1000
+#pragma once
+#endif // _MSC_VER >= 1000
+
+//#define VC_EXTRALEAN		// Exclude rarely-used stuff from Windows headers
+
+
+#include "mbu.h" 
+
+#include <afxwin.h>         // MFC core and standard components
+#include <afxext.h>         // MFC extensions
+#include <afxdisp.h>        // MFC OLE automation classes
+#ifndef _AFX_NO_AFXCMN_SUPPORT
+#include <afxcmn.h>			// MFC support for Windows Common Controls
+#endif // _AFX_NO_AFXCMN_SUPPORT
+
+#include <afxsock.h>		// MFC socket extensions
+
+
+//{{AFX_INSERT_LOCATION}}
+// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
+
+#endif // !defined(AFX_STDAFX_H__A3BAD4AD_F5AE_11D1_8FE9_6CD504C1BC01__INCLUDED_)
Index: trunk/res/Modbucfg.rc2
===================================================================
--- trunk/res/Modbucfg.rc2	(revision 10)
+++ trunk/res/Modbucfg.rc2	(revision 10)
@@ -0,0 +1,13 @@
+//
+// MODBUCFG.RC2 - resources Microsoft Visual C++ does not edit directly
+//
+
+#ifdef APSTUDIO_INVOKED
+	#error this file is not editable by Microsoft Visual C++
+#endif //APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+// Add manually edited resources here...
+
+/////////////////////////////////////////////////////////////////////////////
Index: trunk/resource.h
===================================================================
--- trunk/resource.h	(revision 10)
+++ trunk/resource.h	(revision 10)
@@ -0,0 +1,168 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Visual C++ generated include file.
+// Used by Modbucfg.rc
+//
+#define IDD_ABOUTBOX                    100
+#define IDP_OLE_INIT_FAILED             100
+#define IDD_MODBUCFG_FORM               101
+#define IDB_SPLASH                      102
+#define IDP_SOCKETS_INIT_FAILED         104
+#define IDR_MAINFRAME                   128
+#define IDR_MODBUCTYPE                  129
+#define IDD_MOD_LOCAL_COM_PARAM         130
+#define IDD_CONNECTIONS                 131
+#define IDD_MOD_REM_PARAMETERS          133
+#define IDR_TRAY_ICON                   134
+#define IDD_MEMORY_MAP                  136
+#define IDC_CBO_STOPBITSCB              0x224
+#define IDC_CHK_DTRDSR                  0x225
+#define IDC_CHK_RTSCTS                  0x226
+#define IDC_CHK_XONXOFF                 0x227
+#define IDC_CBO_BYTESIZE                552
+#define IDC_LIST1                       1000
+#define IDC_LST_VALUES                  1000
+#define IDC_FRA_MOD_FUNCTIONS           1001
+#define IDC_CHK_DCOM                    1001
+#define IDC_FRA_MOD_WRITE_FUNCTIONS     1001
+#define IDC_EDIT1                       1002
+#define IDC_EDIT_DCOM_SERVER            1002
+#define IDC_FRA_MOD_FUNCTIONS2          1002
+#define IDC_CBO_FUNCTION                1003
+#define IDC_CHK_TCP_SERVER              1003
+#define IDC_CBO_READ_FUNCTION           1003
+#define IDC_EDIT_DEVICE                 1004
+#define IDC_EDIT_IP_ADDR                1004
+#define IDC_LST_CONNECTIOS              1004
+#define IDC_EDIT_ADDR                   1005
+#define IDC_EDIT_PORT                   1005
+#define IDC_EDIT_QUANT                  1006
+#define IDC_CMD_ADD                     1006
+#define IDC_BUT_START                   1007
+#define IDC_CMD_EDIT                    1007
+#define IDC_BUT_CANCEL                  1008
+#define IDC_CMD_REMOVE                  1008
+#define IDC_CBO_READ_FUNC               1009
+#define IDC_CBO_TYPE                    1009
+#define IDC_CBO_WRITE_FUNCTION          1009
+#define IDC_CBO_BAUD_RATE               1010
+#define IDOKey                          1010
+#define IDC_CBO_CONNECTION              1010
+#define IDC_CHK_SUSPEND                 1011
+#define IDC_CBO_PARITY                  1011
+#define IDC_BUTTON_SAVE                 1011
+#define IDC_CHK_Enable_Poll             1011
+#define IDC_EDIT_TIME_OUT               1012
+#define IDC_BUTTON_LOAD                 1012
+#define IDC_STAT_STATUS                 1013
+#define IDC_EDIT_CHAR_INTERVAL          1013
+#define IDC_EDIT_VALUE                  1014
+#define IDC_CBO_COM_PORT                1014
+#define IDC_CMD_WRITE                   1015
+#define IDC_BUTT_FIND_IP                1015
+#define IDC_CMD_UPDATE                  1016
+#define IDC_OK                          1016
+#define IDC_EDIT_INTERVAL               1016
+#define IDC_STAT_STATUS2                1017
+#define IDC_CHK_ACTIVE                  1017
+#define IDC_STAT_ERROR                  1017
+#define IDC_EDIT_ADDR_WRI               1018
+#define IDC_EDIT_DELAY                  1018
+#define IDC_CBO_DATA_TYPE               1019
+#define IDC_BUTTON_START                1020
+#define IDC_BUTTON_STOP                 1021
+#define IDC_EDIT_QUANT_2                1022
+#define IDC_LIST5                       1029
+#define IDC_RAD_RTU                     1031
+#define IDC_RAD_ASCII                   1032
+#define IDC_EDIT6                       1044
+#define IDC_SPIN2                       1047
+#define IDC_EDIT3                       1050
+#define IDC_EDIT4                       1051
+#define IDC_EDIT5                       1052
+#define IDC_EDIT7                       1053
+#define IDC_EDIT8                       1054
+#define IDC_EDIT9                       1055
+#define IDC_EDIT10                      1056
+#define IDC_EDIT11                      1057
+#define IDC_EDIT12                      1058
+#define IDC_EDIT13                      1059
+#define IDC_EDIT14                      1060
+#define IDC_EDIT15                      1061
+#define IDC_EDIT16                      1062
+#define IDC_EDIT17                      1063
+#define IDC_EDIT18                      1064
+#define IDC_EDIT19                      1065
+#define IDC_EDIT20                      1066
+#define IDC_CMD_READ                    1067
+#define IDC_EDIT21                      1068
+#define IDC_EDIT22                      1069
+#define IDC_EDIT23                      1070
+#define IDC_EDIT24                      1072
+#define IDC_EDIT25                      1073
+#define IDC_EDIT26                      1074
+#define IDC_EDIT27                      1075
+#define IDC_EDIT28                      1076
+#define IDC_EDIT29                      1077
+#define IDC_EDIT30                      1078
+#define IDC_EDIT31                      1079
+#define IDC_EDIT32                      1080
+#define IDC_EDIT33                      1081
+#define IDC_EDIT34                      1082
+#define IDC_EDIT35                      1083
+#define IDC_EDIT36                      1084
+#define IDC_EDIT37                      1085
+#define IDC_EDIT38                      1086
+#define IDC_EDIT39                      1087
+#define IDC_EDIT40                      1088
+#define IDC_EDIT41                      1089
+#define IDC_EDIT42                      1090
+#define IDC_EDIT43                      1091
+#define IDC_EDIT44                      1092
+#define IDC_EDIT45                      1093
+#define IDC_EDIT46                      1094
+#define IDC_EDIT47                      1095
+#define IDC_EDIT48                      1096
+#define IDC_EDIT49                      1097
+#define IDC_EDIT50                      1098
+#define IDC_EDIT51                      1099
+#define IDC_EDIT52                      1100
+#define IDC_EDIT53                      1101
+#define IDC_EDIT54                      1102
+#define IDC_EDIT55                      1103
+#define IDC_EDIT56                      1104
+#define IDC_EDIT57                      1105
+#define IDC_EDIT58                      1106
+#define IDC_EDIT59                      1107
+#define IDC_EDIT60                      1108
+#define IDC_EDIT61                      1109
+#define IDC_EDIT62                      1110
+#define IDC_EDIT63                      1111
+#define IDC_EDIT64                      1112
+#define IDC_EDIT65                      1113
+#define IDC_LIST2                       1152
+#define IDC_LIST3                       1154
+#define IDC_BUTTON1                     1155
+#define IDC_BUTTON2                     1156
+#define ID_VIEW_TEST                    32771
+#define ID_VIEW_TESTLOCALDIALOG         32772
+#define ID_VIEW_TESTCONNECTIONS         32773
+#define ID_VIEW_TEST_CONNECTIONS        32774
+#define ID_OPTIONS_CONNECTIONS          32775
+#define ID_TRAY_EXIT                    32776
+#define ID_OPTIONS_REGISTERTYPELIBRARY  32777
+#define ID_HELP_HOWTOUSE                32778
+#define ID_APP_MEM_MAP                  32779
+#define ID_TRAY_CONNECTIONS             32803
+#define ID_TRAY_MAIN                    32805
+
+// Next default values for new objects
+// 
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_3D_CONTROLS                     1
+#define _APS_NEXT_RESOURCE_VALUE        137
+#define _APS_NEXT_COMMAND_VALUE         32781
+#define _APS_NEXT_CONTROL_VALUE         1157
+#define _APS_NEXT_SYMED_VALUE           103
+#endif
+#endif
