#pragma once
#include "resource.h"
#include "AKAssmsHub.h"
#include "P2Pmsg.h"

#define T_SQLConnect        _T("SQLconnect2server")
#define T_SQLDriverConnect  _T("SQLDriverConnect")

// CConnect2ServerDlg dialog

class CConnect2ServerDlg : public CDialogEx, public P2PeerTarget
{
	  DECLARE_DYNAMIC(CConnect2ServerDlg)

    public:
	      CConnect2ServerDlg ( CWnd* pParent = NULL);   // standard constructor
	    virtual
       ~CConnect2ServerDlg();

    // Dialog Data
	  enum { IDD = IDD_CONNECT2SERVER };
    CString         m_strUsername;
    CString         m_strPassword;
    CComboBox       m_cboAuthentication;
    CComboBox       m_cboServername;
    CString         m_strServername;
    CComboBox       m_cboServerType;
    CComboBox       m_cboUsername;
    CEdit           m_edtPassword;
    P3PmsgNode      m_oNodeThis;

    // Operations
    public:
      void
        ManageControlStatus ( );

    // MFC virtuals
    public:
      virtual
        BOOL OnInitDialog();
    protected:
	    virtual void
        DoDataExchange ( CDataExchange *pDX );    // DDX/DDV support

    // MFC message map
	  DECLARE_MESSAGE_MAP()
    public:
      afx_msg void
        OnBnClickedCancel();
      afx_msg void
        OnClickedBtnConnect2Server();

    // P2PeerMsg_MAP handlers
    // NOTES: Placemarker for map
    protected:
	  DECLARE_P2PeerMsg_MAP()
      msgRESULT
        On_SQLconnect2serverCatch ( P2PeerMsg *pMsg );
      msgRESULT
        On_SQLconnect2serverReflect ( P2PeerMsg *pMsg );
public:
    afx_msg void OnOK();
    afx_msg void OnSelchangeCboAuthentication();
};
