当从新要启动本程序的时候,有用的代码spa
void CServerCenter::Restart(void)
{
char buf[256];
::GetModuleFileName(NULL,buf,sizeof(buf));
CString strPath = buf;
ShowWindow(SW_HIDE);//隐藏本对话框
WinExec(strPath, SW_SHOW);//启动strPath路径下的执行文件
OnOK();//退出当前执行对话框程序
}.net
这样就从新启动了本程序,从头开始。
blog
参考:get
http://blog.csdn.net/foreverhuylee/article/details/22311161
程序