/*
*********************************************************************
*
*	The Essence of OLE
*
*	Source code sample
*
*	Copyright (c) 1996, Rolling Thunder Computing, Ipswich MA
*
*	e-mail: essence@rollthunder.com
*	CompuServe: 73540,3430
*	Web: http://www.rollthunder.com
*
*********************************************************************
*/

// ScriptErrorDlg.cpp : implementation file
//

#include "stdafx.h"
#include "script.h"
#include "ScriptErrorDlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CScriptErrorDlg dialog


CScriptErrorDlg::CScriptErrorDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CScriptErrorDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CScriptErrorDlg)
	m_ErrorName = _T("");
	m_AppName = _T("");
	m_ErrorStatement = _T("(none given)");
	//}}AFX_DATA_INIT
}


void CScriptErrorDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CScriptErrorDlg)
	DDX_Text(pDX, IDC_ERRORNAME, m_ErrorName);
	DDX_Text(pDX, IDC_APPNAME, m_AppName);
	DDX_Text(pDX, IDC_ERRORSTATEMENT, m_ErrorStatement);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CScriptErrorDlg, CDialog)
	//{{AFX_MSG_MAP(CScriptErrorDlg)
	ON_BN_CLICKED(IDC_ABORT, OnAbort)
	ON_BN_CLICKED(IDC_DEBUG, OnDebug)
	ON_BN_CLICKED(IDC_IGNORE, OnIgnore)
	ON_BN_CLICKED(IDC_MOREINFO, OnMoreinfo)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CScriptErrorDlg message handlers

void CScriptErrorDlg::OnAbort() 
{
	EndDialog (IDC_ABORT) ;
}

void CScriptErrorDlg::OnDebug() 
{
	EndDialog (IDC_DEBUG) ;
}

void CScriptErrorDlg::OnIgnore() 
{
	EndDialog (IDC_IGNORE) ;
}

void CScriptErrorDlg::OnMoreinfo() 
{
	::WinHelp (m_hWnd, m_HelpFile, HELP_CONTEXT, m_HelpContext) ;	
}

BOOL CScriptErrorDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	if (m_HelpFile.IsEmpty( ))
	{
		GetDlgItem (IDC_MOREINFO)->EnableWindow (FALSE) ;
	}
	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
