int CALLBACK WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { #ifdef DEBUG //BootLoaderUtil::WaitForDebugger(); #endif #ifndef DEBUG MiniDumpGenerator miniDump; miniDump.showMessageBox(false); #endif BootLoaderUtil::SetCurrentDir(); if (!BootLoaderUtil::SetDllDir(".\\bin")) exit(-100); std::vector<std::string> out; UTIL::STRING::tokenize(gcString(lpCmdLine), out, " "); std::string userAgent; UTIL::STRING::base64_decode(out[2], [&userAgent](const unsigned char* buff, size_t size) -> bool { userAgent.append((const char*)buff, size); return true; }); InitWebControl(out[1].c_str(), userAgent.c_str()); { IPC::PipeServer pipeserver(out[0].c_str(), 1, true); pipeserver.onConnectEvent += delegate(&OnPipeConnect); pipeserver.onDisconnectEvent += delegate(&OnPipeDisconnect); pipeserver.start(); g_WaitCond.wait(15); if (g_bClientConnected) g_WaitCond.wait(); } ShutdownWebControl(); }
BrowserTest::~BrowserTest() { ShutdownWebControl(); }