コード例 #1
0
ファイル: BarcodeRecord.cpp プロジェクト: dulton/brpj
BOOL CBarcodeRecordApp::InitInstance()
{
	// 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
	//读系统配置表
	Set_AllPath();
	DlgSettings.Read2Dlg();

	//打开数据库
	int Error = SQLiteIO.ConnectionDataBase("DataBaseConfig.txt");
	if(Error == ReadFile_FAIL)
	{
//		CDLGWarnning dlgw;
//		dlgw.m_wintxt=Language_ConvertString("Connect Database");					//窗口标题
//		dlgw.m_warntxt=Language_ConvertString("Conn't Read Database Config");		//窗口内容
//		dlgw.DoModal();	

		return FALSE;
	}
	else if(Error == Instance_FAIL)
	{
//		CDLGWarnning dlgw;
//		dlgw.m_wintxt=Language_ConvertString("Connect Database");					//窗口标题
//		dlgw.m_warntxt=Language_ConvertString("Initialization ADO failed");			//窗口内容
//		dlgw.DoModal();
		
		return FALSE;
	}
	else if(Error == ContOpen_FAIL)
	{
//		CDLGWarnning dlgw;
//		dlgw.m_wintxt=Language_ConvertString("Connect Database");					//窗口标题
//		dlgw.m_warntxt=Language_ConvertString("Connet Database Failed");			//窗口内容
//		dlgw.DoModal();

		return FALSE;
	}
	else if(Error == Connectd_DONE)
	{
//		CDLGWarnning dlgw;
//		dlgw.m_wintxt=Language_ConvertString("Connect Database");					//窗口标题
//		dlgw.m_warntxt=Language_ConvertString("Connect Database Successfully");		//窗口内容
//		dlgw.DoModal();
	}

	CBarcodeRecordDlg dlg;
	m_pMainWnd = &dlg;
	int nResponse = dlg.DoModal();
	if (nResponse == IDOK)
	{
		// TODO: Place code here to handle when the dialog is
		//  dismissed with OK
	}
	else if (nResponse == IDCANCEL)
	{
		// TODO: Place code here to handle when the dialog is
		//  dismissed with Cancel
	}

	// Since the dialog has been closed, return FALSE so that we exit the
	//  application, rather than start the application's message pump.
	return FALSE;
}