int main(int argc, char* argv[])
{
	try {
	
#ifdef _DEBUG
		CLog::getInstance().setConsoleLevel(DEBUG);
#else
		CLog::getInstance().setConsoleLevel(WARN);
#endif
		CLog::getInstance().setFileLevel(WARN);
		CLog::getInstance().setLogSourceFileAll(false);
		CLog::getInstance().setLogSourceFile(ERROR, true);
		
		Exception::setLogAllExceptions(true);
		
		
		CMain main;
		main.init(argc, argv);
		main.exec();
	} catch (pugi::xpath_exception& e) {
		printf("XML parsing exception: %s\n", e.what());
		return -1;
	} catch (Exception& e) {
		e.log();
		return -1;
	}
	return 0;
}
Exemple #2
0
STDMETHODIMP CClassFactory::CreateInstance(IUnknown *pUnknownOuter, REFIID riid, void **ppv)
{
	DBGPRINTF(("CClassFactory::CreateInstance(%s)\n", IIDString(riid).c_str()));
	if (pUnknownOuter != nullptr) return CLASS_E_NOAGGREGATION;
	CMain *pMain = new CMain();
	return pMain->QueryInterface(riid, ppv);
}
Exemple #3
0
int main(int argc, char *argv[])
{
	CMain mw;
	if (argc > 0)
		mw.init(argv[1]);
	else
		mw.init(nullptr);
}
Exemple #4
0
void CHLQYDlg::OnBtnDenglu() 
{
	// TODO: Add your control notification handler code here
	

	CString IP = "127.0.0.1";
	UINT	Port = 8080;
//	CString str = CString(m_UID);
//	MessageBox(m_UID,"user");
//	MessageBox(m_PWD,"password");
	MessageBox("正在登陆,请稍后","Attention");
	if(m_SockClient.Connect(IP,Port))
	{
//		MessageBox("Connect to server success!","Attention!");
	
		this->ShowWindow(SW_HIDE);
		CMain  h;
		h.DoModal();
	
	}
	else
	{
		MessageBox("Connect to server failed!","Attention!");
		this->ShowWindow(SW_HIDE);
		CMain  h;
		h.DoModal();
	}

/*	//将客户信息发送给服务器
	if(!m_UID.IsEmpty() && !m_PWD.IsEmpty())
	{
		int snum1,snum2;
		CString mes1 = (CString)"user Id send success";
		CString mes2 = (CString)"user password send success";

		if(snum1 = m_SockClient.Send(m_UID,BUFFER_SIZE))
		{
//			CString mes3;
//			mes3.Format(_T("%d"),snum1);
//			MessageBox("发送字节数:"+mes3,mes1);
		}

//		if(snum2 = m_SockClient.Send(m_PWD.GetBuffer(m_PWD.GetLength()),m_PWD.GetLength()))
		if(snum2 = m_SockClient.Send(m_PWD.GetBuffer(m_PWD.GetLength()),BUFFER_SIZE))
		{
			MessageBox(mes2);
		}
	}
*/
	CString mes1 = (CString)"user information send success!";
	CString mes2 = (CString)"user information send failed!";
	if(!m_UID.IsEmpty() && !m_PWD.IsEmpty())
		if( m_SockClient.SendUserInfor(m_UID,m_PWD))
			MessageBox(mes1);
		else
			MessageBox(mes2);
	
}
Exemple #5
0
/*********************************************************************//*!
 * @brief Program entry
 * 
 * @param argc Command line argument count.
 * @param argv Command line argument strings.
 * @return 0 on success
 *//*********************************************************************/
int main(int argc, char ** argv) {
	CMain main;
	OSC_ERR err=main.Init(argc, argv);
	if(err!=SUCCESS) return(1);
	
	err=main.MainLoop();
	
	return(err);
}
Exemple #6
0
int main(int argc, char *argv[])
{

	CMain* cmain = new CMain(1000, 800, 6135, 1300);
	cmain->GameLoop();
	delete cmain;

    return 0;
}
Exemple #7
0
int main(int argc, char *argv[])
{
	CMain* cmain = new CMain(600, 500);

	cmain->GameLoop();

	delete cmain;

	return 0;
}
Exemple #8
0
/**
 * Construct the control (first phase).
 *  Creates an instance and initializes it.
 *  Instance is left on cleanup stack.
 * @param aRect The rectangle for this window
 * @param aParent owning parent, or NULL
 * @param aCommandObserver command observer
 * @return new instance of CMain
 */
CMain* CMain::NewLC( 
		const TRect& aRect, 
		const CCoeControl* aParent, 
		MEikCommandObserver* aCommandObserver )
	{
	CMain* self = new ( ELeave ) CMain();
	CleanupStack::PushL( self );
	self->ConstructL( aRect, aParent, aCommandObserver );
	return self;
	}
Exemple #9
0
int main(int argc, char* argv[])
{
	int		hr=0;

	CMain	mainApp;
	g_pApp = &mainApp;

	hr = mainApp.Create();
	if(LC_FAILED(hr))
		return LC_OK;

	hr = mainApp.Run(NULL);

	return hr;
}
Exemple #10
0
void* CLAStart(void *pArg)
{
	int nRet = 0;
	CGlobal *cGlob = NULL;
	CModule::ST_MODULE_OPTIONS stOption = *static_cast<CModule::ST_MODULE_OPTIONS*>(pArg);

	cGlob = CGlobal::GetInstance();

	cGlob->SetModuleOption(&stOption);

	nRet = g_cMain.Init(stOption.m_pclsDB, stOption.m_szCfgFile);
	if(nRet == CLA_NOK){
		CLA_LOG(CLA_ERR,false,"Init failed(nRet=%d)\n",nRet);
		return NULL;
	}

	g_cMain.Run();

	return NULL;
}
Exemple #11
0
// Main. Program starts here
int main(int argc, char * argv[]) {
   CheckIntegerTypes();                // Check that compiler has the right integer sizes
   CheckEndianness();                  // Check that machine is little-endian

#ifdef  _DEBUG
   // For debugging only. Remove this
   if (argc == 1) {
      char * dummyarg[] = {"", "@resp.txt"}; // Read command line from file resp.txt
      argc = 2; argv = dummyarg;}
#endif

   cmd.ReadCommandLine(argc, argv);    // Read command line parameters   
   if (cmd.ShowHelp) return 0;         // Help screen has been printed. Do nothing else

   CMain maincvt;                      // This object takes care of all conversions etc.
   maincvt.Go();          
   // Do everything the command line says

   if (cmd.Verbose) printf("\n");      // End with newline
   return err.GetWorstError();         // Return with error code
}
Exemple #12
0
int main(int argc, char* argv[])
{
	CMain app;
	
	return app.OnExecute();
}
Exemple #13
0
int main(void)
{
    CMain Main;
    Main.run();
    return 0;
}
Exemple #14
0
int main(int argc, char** argv)
{
    CMain aMain;
    return aMain.doIt(argc, argv);
}
Exemple #15
0
int main(int argc, char** argv){
  CMain* cMain = new CMain();
  return cMain->Main(argc, argv);
}