// SnaConfig.cpp : implementation file
//

#include "stdafx.h"
#include "SnaConfig.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CSnaConfig dialog


CSnaConfig::CSnaConfig(CWnd* pParent /*=NULL*/)
	: CDialog(CSnaConfig::IDD, pParent)
{
	//{{AFX_DATA_INIT(CSnaConfig)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}


void CSnaConfig::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CSnaConfig)
		// NOTE: the ClassWizard will add DDX and DDV calls here
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CSnaConfig, CDialog)
	//{{AFX_MSG_MAP(CSnaConfig)
	ON_BN_CLICKED(IDC_LAUNCH, OnLaunch)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CSnaConfig message handlers

void CSnaConfig::OnLaunch() 
{
	// launch the SNAEXP utility. If SNA server is installed, its path will be present
	// under HKLM\Software\Microsoft\Sna Server\CurrentVersion\Path
	// When SNA is installed, its path is automatically registered. Just launch
	// without explicit path specification.

	if (WinExec("SNAEXP",SW_SHOW) < 31)
	{
		AfxMessageBox(_T("Error launching SNA Configuration Utility"));
	}
	CDialog::OnOK();
	
}

BOOL CSnaConfig::OnInitDialog() 
{
	CString msg;
	if (!msg.LoadString(IDS_SNACFG_MSG))
	{
		ASSERT(FALSE);
		return FALSE;
	}
	CDialog::OnInitDialog();
	(GetDlgItem(IDC_SNASERVER_TEXT)	)->SetWindowText(msg);
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
