
// FileOperationDlg.cpp : t@C
//

#include "stdafx.h"
#include "FileOperation.h"
#include "FileOperationDlg.h"
#include "afxdialogex.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#endif

// CFileOperationDlg _CAO



CFileOperationDlg::CFileOperationDlg(CWnd* pParent /*=NULL*/)
	: CDialogEx(IDD_FILEOPERATION_DIALOG, pParent)
{
	m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}

void CFileOperationDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialogEx::DoDataExchange(pDX);
	DDX_Control(pDX, IDC_EDIT_DEVICENAME,	m_edit_device_name);
	DDX_Control(pDX, IDC_EDIT_RETURNNUM,	m_edit_returnnum);
	DDX_Control(pDX, IDC_EDIT_STATUS,		m_edit_applicationstatus);
	DDX_Control(pDX, IDC_MFCEDITBROWSE_SETTINGFILE,			m_edit_settingfile);
	DDX_Control(pDX, IDC_MFCEDITBROWSE_ARBITRATYDATAFILE,	m_edit_arbitrarydatafile);
	DDX_Control(pDX, IDC_COMBO_OPENMODE,	m_combo_openmode);
	DDX_Control(pDX, IDC_COMBO_AOCHANNEL,	m_combo_aochannel);
	DDX_Control(pDX, IDC_COMBO_WAVETYPE,	m_combo_wavetype);
	DDX_Control(pDX, IDC_COMBO_PARAM,		m_combo_param);
}

BEGIN_MESSAGE_MAP(CFileOperationDlg, CDialogEx)
	ON_WM_SYSCOMMAND()
	ON_WM_PAINT()
	ON_WM_QUERYDRAGICON()
	ON_BN_CLICKED(IDC_BUTTON_OPENAPPLICATION,		&CFileOperationDlg::OnBnClickedButtonOpenapplication)
	ON_BN_CLICKED(IDC_BUTTON_SETDEVICENAME,			&CFileOperationDlg::OnBnClickedButtonSetdevicename)
	ON_BN_CLICKED(IDC_BUTTON_EXPORTSETTINGFILE,		&CFileOperationDlg::OnBnClickedButtonExportsettingfile)
	ON_BN_CLICKED(IDC_BUTTON_IMPORTSETTINGFILE,		&CFileOperationDlg::OnBnClickedButtonImportsettingfile)
	ON_BN_CLICKED(IDC_BUTTON_SETWAVETYPE,			&CFileOperationDlg::OnBnClickedButtonSetwavetype)
	ON_BN_CLICKED(IDC_BUTTON_SETARBITRARYDATAFILE,	&CFileOperationDlg::OnBnClickedButtonSetarbitrarydatafile)
	ON_BN_CLICKED(IDC_BUTTON_GETARBITRARYDATAFILE,	&CFileOperationDlg::OnBnClickedButtonGetarbitrarydatafile)
	ON_BN_CLICKED(IDC_BUTTON_SAVEDATAFILE,			&CFileOperationDlg::OnBnClickedButtonSavedatafile)
	ON_BN_CLICKED(IDC_BUTTON_STARTOPERATION,		&CFileOperationDlg::OnBnClickedButtonStartoperation)
	ON_BN_CLICKED(IDC_BUTTON_GETAPPLICATIONSTATUS,	&CFileOperationDlg::OnBnClickedButtonGetapplicationstatus)
	ON_BN_CLICKED(IDC_BUTTON_STOPOPEREATION,		&CFileOperationDlg::OnBnClickedButtonStopopereation)
	ON_BN_CLICKED(IDC_BUTTON_CLOSE,					&CFileOperationDlg::OnBnClickedButtonClose)
	ON_BN_CLICKED(IDCLOSE, &CFileOperationDlg::OnBnClickedClose)
END_MESSAGE_MAP()


//----------------------------------------
// }N`
//----------------------------------------
#define AO_CHANNEL							0		// AiOo̓`lԍ	: 0
#define CWAVEFORMGENERATOR_CHANNELS			16		// ő`l

// CFileOperationDlg bZ[W nh[
//================================================================================
// ݒ
//================================================================================
BOOL CFileOperationDlg::OnInitDialog()
{
	CDialogEx::OnInitDialog();
	CString		str_status;
	CString		text_temp;			// eLXgꎞi[p
	HRESULT		hr;

	//----------------------------------------
	// C-WaveFormGeneratorSDKŌĂяo߂̏
	//----------------------------------------
	try
	{
		//----------------------------------------
		// ɋNĂC-WaveformGenerator̃|C^擾
		//----------------------------------------
		hr = c_fgen.GetActiveObject(__uuidof(CCWaveformGenerator));
		//----------------------------------------
		// NAṽ|C^擾ɎsꍇAVKSDKpIuWFNg̐
		//----------------------------------------
		if ((FAILED(hr)))
		{
			//----------------------------------------
			// SDKpIuWFNg̐VK
			//----------------------------------------
			hr = c_fgen.CreateInstance(__uuidof(CCWaveformGenerator));
			if (FAILED(hr)) {
				_com_issue_error(hr);
			}
		}
	}
	//----------------------------------------
	// SDKpIuWFNg̐sAG[bZ[W\
	//----------------------------------------
	catch (_com_error& /*ce*/)
	{
		str_status.Format(_T("Unanticipated exception initializing ICWaveformGeneratorPtr object."));
		m_edit_returnnum.SetWindowText(str_status);
		return FALSE;
	}
	//----------------------------------------
	// ̑G[̎AG[bZ[W\
	//----------------------------------------
	catch (...)
	{
		AfxMessageBox(_T("Unanticipated exception initializing ICWaveformGeneratorPtr object."));
		EndDialog(IDABORT);
		return FALSE;
	}

	// ̃_CAÕACRݒ肵܂BAvP[ṼC EBhE_CAOłȂꍇA
	//  Framework ́A̐ݒIɍs܂B
	SetIcon(m_hIcon, TRUE);			// 傫ACR̐ݒ
	SetIcon(m_hIcon, FALSE);		// ACR̐ݒ

	//----------------------------------------
	// foCX̏\XV
	//----------------------------------------
	m_edit_device_name.SetWindowTextW(_T("AIO000"));
	//----------------------------------------
	// ʃTCYR{{bNX̍쐬
	//----------------------------------------
	m_combo_openmode.AddString(_T("ŏ"));
	m_combo_openmode.AddString(_T("ʏ"));
	m_combo_openmode.AddString(_T("ő剻"));
	//----------------------------------------
	// ʃTCYpR{{bNX̑I0ԂɕύX
	//----------------------------------------
	m_combo_openmode.SetCurSel(0);
	//----------------------------------------
	// `lԍR{{bNX̍쐬
	//----------------------------------------
	for (int i = 0; i < CWAVEFORMGENERATOR_CHANNELS; i++) {
		text_temp.Format(_T("%d"), i);
		m_combo_aochannel.AddString(text_temp);
	}
	//----------------------------------------
	// `lԍR{{bNX̑I0ԂɕύX
	//----------------------------------------
	m_combo_aochannel.SetCurSel(0);
	//----------------------------------------
	// g`^CvR{{bNX̍쐬
	//----------------------------------------
	m_combo_wavetype.AddString(_T(""));
	m_combo_wavetype.AddString(_T("Œ"));
	m_combo_wavetype.AddString(_T("Op"));
	m_combo_wavetype.AddString(_T("̂"));
	m_combo_wavetype.AddString(_T("`"));
	m_combo_wavetype.AddString(_T("mCY"));
	m_combo_wavetype.AddString(_T("C"));
	//----------------------------------------
	// g`^CvR{{bNX̑I0ԂɕύX
	//----------------------------------------
	m_combo_wavetype.SetCurSel(0);
	//----------------------------------------
	// f[^ۑR{{bNX̍쐬
	//----------------------------------------
	m_combo_param.AddString(_T("P`l"));
	m_combo_param.AddString(_T("`l"));
	//----------------------------------------
	// f[^ۑR{{bNX̑I0ԂɕύX
	//----------------------------------------
	m_combo_param.SetCurSel(0);
	return TRUE;  // tH[JXRg[ɐݒ肵ꍇATRUE Ԃ܂B
}


// _CAOɍŏ{^ǉꍇAACR`悷邽߂
//  ̃R[hKvłBhLg/r[ fg MFC AvP[V̏ꍇA
//  ́AFramework ɂĎIɐݒ肳܂B

void CFileOperationDlg::OnPaint()
{
	if (IsIconic())
	{
		CPaintDC dc(this); // `̃foCX ReLXg

		SendMessage(WM_ICONERASEBKGND, reinterpret_cast<WPARAM>(dc.GetSafeHdc()), 0);

		// NCAg̎lp`̈̒
		int cxIcon = GetSystemMetrics(SM_CXICON);
		int cyIcon = GetSystemMetrics(SM_CYICON);
		CRect rect;
		GetClientRect(&rect);
		int x = (rect.Width() - cxIcon + 1) / 2;
		int y = (rect.Height() - cyIcon + 1) / 2;

		// ACR̕`
		dc.DrawIcon(x, y, m_hIcon);
	}
	else
	{
		CDialogEx::OnPaint();
	}
}

// [U[ŏEBhEhbOĂƂɕ\J[\擾邽߂ɁA
//  VXe̊֐Ăяo܂B
HCURSOR CFileOperationDlg::OnQueryDragIcon()
{
	return static_cast<HCURSOR>(m_hIcon);
}


//================================================================================
// OpenApplication{^NbNۂ̏ɂȂ܂
// Av̏s܂
//================================================================================
void CFileOperationDlg::OnBnClickedButtonOpenapplication()
{
	BSTR	device_name;		// foCX
	char	arg1[256];			// \
	short	openmode;			// ʃTCY
	long	ret;				// ߂l擾p
	CString	text_temp;			// eLXgꎞi[p
	CString	text_string;		// G[R[h\p

	//----------------------------------------
	// eLXg{bNXfoCX擾
	//----------------------------------------
	m_edit_device_name.GetWindowText(text_temp);
	device_name = text_temp.AllocSysString();
	//----------------------------------------
	// R{{bNXʃTCY擾
	//----------------------------------------
	openmode = m_combo_openmode.GetCurSel();
	//----------------------------------------
	// Arg1i\j
	//----------------------------------------
	sprintf_s(arg1, "");
	//----------------------------------------
	// Av̏s
	//----------------------------------------
	try
	{
		ret = c_fgen->OpenApplication(openmode, device_name, arg1);
	}
	catch (...)
	{
		AfxMessageBox(_T("Unanticipated exception cannot found ICWaveformGeneratorPtr object."));
		return;
	}
	//----------------------------------------
	// J
	//----------------------------------------
	SysFreeString(device_name);
	//----------------------------------------
	// G[R[h\
	//----------------------------------------
	text_string.Format(_T("OpenApplication = %d "), ret);
	m_edit_returnnum.SetWindowText(text_string);
}

//================================================================================
// SetDeviceName{^NbNۂ̏ɂȂ܂
// foCX̐ݒs܂
//================================================================================
void CFileOperationDlg::OnBnClickedButtonSetdevicename()
{
	BSTR	device_name;		// foCX
	long	ret;				// ߂l擾p
	CString	text_temp;			// eLXgꎞi[p
	CString	text_string;		// G[R[h\p

	//----------------------------------------
	// eLXg{bNXݒt@C擾
	//----------------------------------------
	m_edit_device_name.GetWindowText(text_temp);
	device_name = text_temp.AllocSysString();
	//----------------------------------------
	// foCX̐ݒ
	//----------------------------------------
	try
	{
		ret		= c_fgen->SetDeviceName(device_name);
	}
	catch (...)
	{
		AfxMessageBox(_T("Unanticipated exception cannot found ICWaveformGeneratorPtr object."));
		return;
	}
	//----------------------------------------
	// J
	//----------------------------------------
	SysFreeString(device_name);
	//----------------------------------------
	// G[R[h\
	//----------------------------------------
	text_string.Format(_T("SetDeviceName = %d "), ret);
	m_edit_returnnum.SetWindowText(text_string);
}

//================================================================================
// ExportSettingFile{^NbNۂ̏ɂȂ܂
// ݒinit@Cɕۑ܂
//================================================================================
void CFileOperationDlg::OnBnClickedButtonExportsettingfile()
{
	BSTR	filepath;			// t@CpX
	short	arg1;				// \
	long	ret;				// ߂l擾p
	CString	text_temp;			// eLXgꎞi[p
	CString	text_string;		// G[R[h\p

	//----------------------------------------
	// eLXg{bNXݒt@CpX擾
	//----------------------------------------
	m_edit_settingfile.GetWindowText(text_temp);
	filepath = text_temp.AllocSysString();
	//----------------------------------------
	// arg1i\j
	//----------------------------------------
	arg1	= 0;
	//----------------------------------------
	// ݒinit@Cɕۑ
	//----------------------------------------
	try
	{
		ret	= c_fgen->ExportSettingFile(filepath, arg1);
	}
	catch (...)
	{
		AfxMessageBox(_T("Unanticipated exception cannot found ICWaveformGeneratorPtr object."));
		return;
	}
	//----------------------------------------
	// J
	//----------------------------------------
	SysFreeString(filepath);
	//----------------------------------------
	// G[R[h\
	//----------------------------------------
	text_string.Format(_T("ExportSettingFile = %d "), ret);
	m_edit_returnnum.SetWindowText(text_string);
}

//================================================================================
// ImportSettingFile{^NbNۂ̏ɂȂ܂
// init@C̐ݒǂݍ݂܂B
//================================================================================
void CFileOperationDlg::OnBnClickedButtonImportsettingfile()
{
	BSTR	filepath;			// t@CpX
	short	arg1;				// \
	long	ret;				// ߂l擾p
	CString	text_temp;			// eLXgꎞi[p
	CString	text_string;		// G[R[h\p

	//----------------------------------------
	// eLXg{bNXݒt@CpX擾
	//----------------------------------------
	m_edit_settingfile.GetWindowText(text_temp);
	filepath = text_temp.AllocSysString();
	//----------------------------------------
	// arg1i\j
	//----------------------------------------
	arg1	= 0;
	//----------------------------------------
	// init@C̐ݒǂݏos
	//----------------------------------------
	try
	{
		ret	= c_fgen->ImportSettingFile(filepath, arg1);
	}
	catch (...)
	{
		AfxMessageBox(_T("Unanticipated exception cannot found ICWaveformGeneratorPtr object."));
		return;
	}
	//----------------------------------------
	// J
	//----------------------------------------
	SysFreeString(filepath);
	//----------------------------------------
	// G[R[h\
	//----------------------------------------
	text_string.Format(_T("ImportSettingFile = %d "), ret);
	m_edit_returnnum.SetWindowText(text_string);
}

//================================================================================
// SetWaveType{^NbNۂ̏ɂȂ܂
// g`^Cv̐ݒs܂
//================================================================================
void CFileOperationDlg::OnBnClickedButtonSetwavetype()
{
	short	wavetype;			// g`^Cv
	short	aochannel;			// `lԍ
	short	arg1;				// \
	long	ret;				// ߂l擾p
	CString	text_string;		// G[R[h\p

	//----------------------------------------
	// R{{bNXg`^Cv擾
	//----------------------------------------
	wavetype	= m_combo_wavetype.GetCurSel();
	//----------------------------------------
	// R{{bNX`lԍ擾
	//----------------------------------------
	aochannel	= m_combo_aochannel.GetCurSel();
	//----------------------------------------
	// arg1i\j
	//----------------------------------------
	arg1		= 0;
	//----------------------------------------
	// g`^Cv̐ݒs
	//----------------------------------------
	try
	{
		ret		= c_fgen->SetWaveType(aochannel, wavetype, arg1);
	}
	catch (...)
	{
		AfxMessageBox(_T("Unanticipated exception cannot found ICWaveformGeneratorPtr object."));
		return;
	}
	//----------------------------------------
	// G[R[h\
	//----------------------------------------
	text_string.Format(_T("SetWaveType = %d "), ret);
	m_edit_returnnum.SetWindowText(text_string);
}

//================================================================================
// SetArbitraryDataFile{^NbNۂ̏ɂȂ܂
// f[^t@Cicsvt@CjpXݒ肵܂
//================================================================================
void CFileOperationDlg::OnBnClickedButtonSetarbitrarydatafile()
{
	BSTR	filepath;			// t@CpX
	short	aochannel;			// `lԍ
	short	arg1;				// \
	long	ret;				// ߂l擾p
	CString	text_temp;			// eLXgꎞi[p
	CString	text_string;		// G[R[h\p

	//----------------------------------------
	// eLXg{bNXf[^t@CpX擾
	//----------------------------------------
	m_edit_arbitrarydatafile.GetWindowText(text_temp);
	filepath	= text_temp.AllocSysString();
	//----------------------------------------
	// R{{bNX`lԍ擾
	//----------------------------------------
	aochannel	= m_combo_aochannel.GetCurSel();
	//----------------------------------------
	// arg1i\j
	//----------------------------------------
	arg1		= 0;
	//----------------------------------------
	// f[^t@CpX̐ݒ
	//----------------------------------------
	try
	{
		ret		= c_fgen->SetArbitraryDataFile(aochannel, filepath, arg1);
	}
	catch (...)
	{
		AfxMessageBox(_T("Unanticipated exception cannot found ICWaveformGeneratorPtr object."));
		return;
	}
	//----------------------------------------
	// J
	//----------------------------------------
	SysFreeString(filepath);
	//----------------------------------------
	// G[R[h\
	//----------------------------------------
	text_string.Format(_T("SetArbitraryDataFile = %d "), ret);
	m_edit_returnnum.SetWindowText(text_string);
}

//================================================================================
// GetArbitraryDataFile{^NbNۂ̏ɂȂ܂
// ݒ肳Ăf[^t@Cicsvt@CjpX擾܂
//================================================================================
void CFileOperationDlg::OnBnClickedButtonGetarbitrarydatafile()
{
	BSTR	filepath;			// t@CpX
	short	aochannel;			// `lԍ
	short	arg1;				// \
	long	ret;				// ߂l擾p
	CString	text_temp;			// eLXgꎞi[p
	CString	text_string;		// G[R[h\p

	arg1		= 0;
	filepath	= NULL;
	//----------------------------------------
	// ݒ肳Ă`l擾
	//----------------------------------------
	aochannel	= m_combo_aochannel.GetCurSel();
	//----------------------------------------
	// f[^t@CpX̎擾
	//----------------------------------------
	try
	{
		ret		= c_fgen->GetArbitraryDataFile(aochannel, &filepath, &arg1);
	}
	catch (...)
	{
		AfxMessageBox(_T("Unanticipated exception cannot found ICWaveformGeneratorPtr object."));
		return;
	}
	//----------------------------------------
	// G[R[h\
	//----------------------------------------
	text_string.Format(_T("GetArbitraryDataFile = %d "), ret);
	m_edit_returnnum.SetWindowText(text_string);
	//----------------------------------------
	// f[^t@CpX\
	//----------------------------------------
	text_temp.Format(_T("%s"), filepath);
	m_edit_arbitrarydatafile.SetWindowText(text_temp);
	//----------------------------------------
	// J
	//----------------------------------------
	SysFreeString(filepath);
}

//================================================================================
// SaveDataFile{^NbNۂ̏ɂȂ܂
// w肵`l̃f[^csvt@Cɕۑ܂
//================================================================================
void CFileOperationDlg::OnBnClickedButtonSavedatafile()
{
	BSTR	filepath;			// t@CpX
	short	aochannel;			// `lԍ
	short	param;				// Por
	long	ret;				// ߂l擾p
	CString	text_temp;			// eLXgꎞi[p
	CString	text_string;		// G[R[h\p

	//----------------------------------------
	// eLXg{bNXf[^t@C擾
	//----------------------------------------
	m_edit_arbitrarydatafile.GetWindowText(text_temp);
	filepath	= text_temp.AllocSysString();
	//----------------------------------------
	// R{{bNX`l̃p[^iPorj擾
	//----------------------------------------
	param		= m_combo_param.GetCurSel();
	//----------------------------------------
	// R{{bNX`lԍ擾
	//----------------------------------------
	aochannel	= m_combo_aochannel.GetCurSel();
	//----------------------------------------
	// f[^t@C̐ݒ
	//----------------------------------------
	//-------------------
	// P`l̏ꍇA3`lԍɂ
	//-------------------
	if (param == 0) {
		try
		{
			ret	= c_fgen->SaveDataFile(filepath, param, aochannel);
		}
		catch (...)
		{
			AfxMessageBox(_T("Unanticipated exception cannot found ICWaveformGeneratorPtr object."));
			return;
		}
	}
	//-------------------
	// `l̏ꍇA30ɂ
	//-------------------
	else {
		try
		{
			ret	= c_fgen->SaveDataFile(filepath, param, 0);
		}
		catch (...)
		{
			AfxMessageBox(_T("Unanticipated exception cannot found ICWaveformGeneratorPtr object."));
			return;
		}
	}
	//----------------------------------------
	// J
	//----------------------------------------
	SysFreeString(filepath);
	//----------------------------------------
	// G[R[h\
	//----------------------------------------
	text_string.Format(_T("SaveDataFile = %d "), ret);
	m_edit_returnnum.SetWindowText(text_string);
}

//================================================================================
// StartOperation{^NbNۂ̏ɂȂ܂
// Av̏o͊Jns܂
//================================================================================
void CFileOperationDlg::OnBnClickedButtonStartoperation()
{
	short	arg1;				// \
	long	ret;				// ߂l擾p
	CString	text_string;		// G[R[h\p

	//----------------------------------------
	// arg1i\j
	//----------------------------------------
	arg1	= 0;
	//----------------------------------------
	// Av̏o͊Jns
	//----------------------------------------
	try
	{
		ret	= c_fgen->StartOperation(arg1);
	}
	catch (...)
	{
		AfxMessageBox(_T("Unanticipated exception cannot found ICWaveformGeneratorPtr object."));
		return;
	}
	//----------------------------------------
	// G[R[h\
	//----------------------------------------
	text_string.Format(_T("StartOperation = %d "), ret);
	m_edit_returnnum.SetWindowText(text_string);
}

//================================================================================
// GetApplicationStatus{^NbNۂ̏ɂȂ܂
// 󋵂̎擾s܂
//================================================================================
void CFileOperationDlg::OnBnClickedButtonGetapplicationstatus()
{
	long	status = -1;		// Xe[^X
	long	ret;				// ߂l擾p
	CString	text_temp;			// eLXgꎞi[p
	CString	text_string;		// G[R[h\p

	//----------------------------------------
	//  󋵂̎擾s
	//----------------------------------------
	try
	{
		ret = c_fgen->GetApplicationStatus(&status);
	}
	catch (...)
	{
		AfxMessageBox(_T("Unanticipated exception cannot found ICWaveformGeneratorPtr object."));
		return;
	}
	//----------------------------------------
	// G[R[h\
	//----------------------------------------
	text_string.Format(_T("GetApplicationStatus = %d "), ret);
	m_edit_returnnum.SetWindowText(text_string);
	//----------------------------------------
	// Xe[^X\
	//----------------------------------------
	if (status == 0) {
		text_temp.Format(_T("00H(~)"));
	}
	else if (status == 1) {
		text_temp.Format(_T("01H(쒆)"));
	}
	else if (status == 2) {
		text_temp.Format(_T("02H(JngK҂)"));
	}
	else if (status == 3) {
		text_temp.Format(_T("03H(쒆AJngK҂)"));
	}
	else {
		text_temp.Format(_T("%d "), status);
	}
	m_edit_applicationstatus.SetWindowText(text_temp);
}

//================================================================================
// StopOperation{^NbNۂ̏ɂȂ܂
// Av̏o͒~s܂
//================================================================================
void CFileOperationDlg::OnBnClickedButtonStopopereation()
{
	short	arg1;				// \
	long	ret;				// ߂l擾p
	CString	text_string;		// G[R[h\p

	//----------------------------------------
	// arg1i\j
	//----------------------------------------
	arg1	= 0;
	//----------------------------------------
	// Av̏o͒~s
	//----------------------------------------
	try
	{
		ret	= c_fgen->StopOperation(arg1);
	}
	catch (...)
	{
		AfxMessageBox(_T("Unanticipated exception cannot found ICWaveformGeneratorPtr object."));
		return;
	}
	//----------------------------------------
	// G[R[h\
	//----------------------------------------
	text_string.Format(_T("StopOperation = %d "), ret);
	m_edit_returnnum.SetWindowText(text_string);
}

//================================================================================
// CloseApplication{^NbNۂ̏ɂȂ܂
// foCX̏Is܂
//================================================================================
void CFileOperationDlg::OnBnClickedButtonClose()
{
	short	arg1;				// \
	long	ret;				// ߂l擾p
	CString	text_string;		// G[R[h\p

	//----------------------------------------
	// arg1i\j
	//----------------------------------------
	arg1	= 0;
	//----------------------------------------
	// foCX̏Is
	//----------------------------------------
	try
	{
		ret	= c_fgen->CloseApplication(arg1);
	}
	catch (...)
	{
		AfxMessageBox(_T("Unanticipated exception cannot found ICWaveformGeneratorPtr object."));
		return;
	}
	//----------------------------------------
	// G[R[h\
	//----------------------------------------
	text_string.Format(_T("CloseApplication = %d "), ret);
	m_edit_returnnum.SetWindowText(text_string);
}

void CFileOperationDlg::OnBnClickedClose()
{
	short	arg1;				// \
	long	ret;				// ߂l擾p

	//----------------------------------------
	// arg1i\j
	//----------------------------------------
	arg1	= 0;
	// TODO: ɃRg[ʒmnh[ R[hǉ܂B
	//----------------------------------------
	// foCX̏Is
	//----------------------------------------
	try
	{
		ret	= c_fgen->CloseApplication(arg1);
	}
	catch (...)
	{
	}
	//----------------------------------------
	// _CAOI
	//----------------------------------------
	CDialog::OnOK();
}
