CAuctionServerDoc::CAuctionServerDoc() : 
    m_stateAuction(E_NONE)
{
	// TODO: add one-time construction code here
	msgRequestQueue.Clean();
	msgResponseQueue.Clean();

	CString strConn;

	CString strPath = GetCurAppPath();
	strPath += _T("\\Data\\Data.accdb");
	CString strPwd = _T("");
	strConn.Format(
		_T("DRIVER=MICROSOFT ACCESS DRIVER (*.mdb, *.accdb);DSN='';DBQ=%s;Uid=Admin;Pwd=%s;"),
		strPath,
		strPwd);

	m_dbConn.SetConnectionString(strConn);
	if (m_dbConn.Open() == false)
	{
		return;
	}

    //m_pThreadProcessRequestQueue = AfxBeginThread(
    //    ProcessRequestQueueThread,
    //    this);

    //m_pThreadProcessResponseQueue = AfxBeginThread(
    //    ProcessResponseQueueThread,
    //    this);

}
Ejemplo n.º 2
0
void CDlgFtpDown::OnClickTree(NMHDR* pNMHDR, LRESULT* pResult) 
{
	UINT uFlag;
	CPoint pt;
	HTREEITEM hSelRoot;
	GetCursorPos(&pt);
	m_tree.ScreenToClient(&pt);
	hSelRoot = m_tree.HitTest(pt,&uFlag);
	if ((NULL!=hSelRoot) && (uFlag&TVHT_ONITEM))
	{
		char* strBuf=NULL;
		strBuf = (char*) m_tree.GetItemData(hSelRoot);
		if(NULL == strBuf) return;

		CString strArxPath = GetCurAppPath();
		CString strTargeFile;
		strTargeFile.Format("%sFtp\\%s.dwg",strArxPath,m_tree.GetItemText(hSelRoot));

		CString strSourceFile,strTempA,strTempB;

		HTREEITEM hParent = hSelRoot;
		while((hParent = m_tree.GetParentItem(hParent))!=NULL)
		{
			strTempA = m_tree.GetItemText(hParent);
			strTempB = strTempA+"/"+strTempB;
		}
		strSourceFile.Format("Material/%s/%s%s",m_strProjectId,strTempB,strBuf);

		CDlgFTPTransfer dlg;
		dlg.m_sServer = m_strServer;
		dlg.m_sUserName = m_strUserName;
		dlg.m_sPassword = m_strPassword;
		dlg.m_nPort = m_nPort;
		dlg.m_sRemoteFile = strSourceFile;
		dlg.m_sLocalFile = strTargeFile;
		dlg.m_sFileName = strTargeFile;
		dlg.m_bDownload = TRUE;
		dlg.m_bBinary = TRUE;

		if (dlg.DoModal() != IDOK)
		{
			return;
		}

		CDistEntityTool tempTool;
		tempTool.OpenDwgFile(strTargeFile);
	}

	*pResult = 0;
}