本文整理汇总了C++中CMainDlg::UpdateLists方法的典型用法代码示例。如果您正苦于以下问题:C++ CMainDlg::UpdateLists方法的具体用法?C++ CMainDlg::UpdateLists怎么用?C++ CMainDlg::UpdateLists使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CMainDlg
的用法示例。
在下文中一共展示了CMainDlg::UpdateLists方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _tWinMain
int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPTSTR lpstrCmdLine, int /*nCmdShow*/)
{
HRESULT hRes = ::OleInitialize(NULL);
//HRESULT hRes = ::CoInitialize(NULL);
// If you are running on NT 4.0 or higher you can use the following call instead to
// make the EXE free threaded. This means that calls come in on a random RPC thread.
// HRESULT hRes = ::CoInitializeEx(NULL, COINIT_MULTITHREADED);
ATLASSERT(SUCCEEDED(hRes));
// this resolves ATL window thunking problem when Microsoft Layer for Unicode (MSLU) is used
::DefWindowProc(NULL, 0, 0, 0L);
AtlInitCommonControls(ICC_BAR_CLASSES | ICC_DATE_CLASSES); // add flags to support other controls
hRes = _Module.Init(NULL, hInstance);
ATLASSERT(SUCCEEDED(hRes));
AtlAxWinInit();
int nRet = 0;
try
{ CMainDlg dlgMain;
//DebugFileOut debugfile(CString((::ExeDirectory() + "debug.txt").c_str()));
// basic_debugbuf debugbuf(2048);
// std::cout.rdbuf(&debugfile);
// cout<< "Test Me" << endl;
//
//
// Yaml storage ;
// ParseIniFile("C:\\Program Files\\MTConnect\\Agent\\Agent.cfg", storage );
// BLOCK: Run application
std::string cfgfilename;
std::string destinationfolder("C:\\Program Files\\MTConnect\\Agent\\");
options_description desc("Allowed options");
AtlTrace(StdStringFormat("AgentCfg=%s\n",lpstrCmdLine).c_str() );
desc.add_options()
("-f", value<std::string>(), "ConfigFile")
("-p", value<std::string>(), "HTTP Port")
("-d", value<std::string>(), "Destination folder")
("-restart", "Restart Agent Service")
;
if(__argc > 1)
{
try {
variables_map vm;
std::vector<std::string> args = split_winmain(lpstrCmdLine);
store(command_line_parser(args).options(desc).run(), vm);
if (vm.count("-f")) { cfgfilename= vm["-f"].as<std::string>();}
if (vm.count("-p")) { dlgMain.HttpPort() = vm["-p"].as<std::string>();}
if (vm.count("-d")) { destinationfolder= vm["-d"].as<std::string>();}
}
catch(std::exception e)
{
AtlTrace(e.what());
}
AtlTrace(StdStringFormat("AgentCfg CfgFile=%s\n",cfgfilename.c_str()).c_str() );
AtlTrace(StdStringFormat("AgentCfg Destinationfolder=%s\n",destinationfolder.c_str()).c_str() );
// FIXME: error checking
std::string contents;
ReplaceAll(cfgfilename,"\"", "");
ReplaceAll(destinationfolder,"\"", "");
ReadFile(cfgfilename, contents);
AtlTrace(contents.c_str());
dlgMain.UpdateLists(contents);
dlgMain.WriteCfgFile(destinationfolder);
}
else
{
nRet = dlgMain.DoModal();
}
}
catch(...)
{
OutputDebugString("_tWinMain Exception \n ");
}
_Module.Term();
::CoUninitialize();
return nRet;
}