Command LineProgramYou can also set multiple stopovers. I checked a lot onlineArticleAll of them are in the administrative window. Here I have a command line, and the framework is very simple, as shown below:
// VRP. cpp: defines the entry point of the console application. // # Include "stdafx. H "# include" windows. H "# include" VRP. H "DWORD g_dwripthreadid = 0; DWORD g_dwospfthreadid = 0; int _ tmain (INT argc, _ tchar * argv []) {_ tprintf (_ T (" info: VRP is starting... \ n "); lpvoid pvripparameter = NULL; handle hrip = createthread (null, 0, rip_threadproc, pvripparameter, 0, & g_dwripthreadid); If (null = hrip) {_ tprintf (_ T ("erro: Rip thread create failure! \ N "); Return 0;} _ tprintf (_ T (" info: Rip thread create success! \ N ")); //////////////////////////////////////// ///////////// lpvoid pvospfparameter = NULL ;; handle hospf = createthread (null, 0, ospf_threadproc, pvospfparameter, 0, & g_dwospfthreadid); If (null = hospf) {_ tprintf (_ T ("erro: OSPF thread create failure! \ N "); Return 0;} _ tprintf (_ T (" info: OSPF thread create success! \ N ")); //////////////////////////////////////// //// // sleep (2000 ); uint MSG = my_msg; int COUNT = 0; tchar * wparam = new tchar [max_info_size]; // create dynamic MSG lparam iparam = NULL; while (true) {sleep (2000 ); if (0 = count % 2) {_ stprintf (wparam, _ T ("Main-> rip MSG _ % d"), ++ count ); // If (false = postthreadmessage (g_dwripthreadid, MSG, (wparam) wparam, iparam) {_ tprintf (_ T ("erro: P Ostthreadmessage-> rip failure! \ N ") ;}} else {_ stprintf (wparam, _ T (" Main-> ospf msg _ % d "), ++ count ); // If (false = postthreadmessage (g_dwospfthreadid, MSG, (wparam) wparam, iparam) {_ tprintf (_ T ("erro: postthreadmessage-> OSPF failure! \ N ") ;}}// lresult sendmessage (hwnd, uint MSG, wparam, lparam iparam);} closehandle (hrip); closehandle (hospf ); getchar (); Return 0;} // DWORD winapi rip_threadproc (lpvoid lpparam) {// _ tprintf (_ T ("info: rip_task has been created! \ N "); MSG; _ tchar * pinfo = NULL; peekmessage (& MSG, null, wm_user, wm_user, pm_noremove ); // message sending volume uint uimsg = my_msg; int icount = 0; tchar * wparam = new tchar [max_info_size]; // create dynamic MSG lparam iparam = NULL; while (true) {If (getmessage (& MSG, null, 0, 0) // get MSG from Message Queue {Switch (MSG. message) {Case my_msg: pinfo = (_ tchar *) MSG. wparam; _ tprintf (_ T ("Rip: Recv % s \ n"), P Info); break ;}}_ stprintf (wparam, _ T ("Rip-> ospf msg _ % d"), ++ icount); // sleep (2000 ); if (false = postthreadmessage (g_dwospfthreadid, uimsg, (wparam) wparam, iparam) {_ tprintf (_ T ("erro: postthreadmessage-> rip failure! \ N ") ;}}// Delete pinfo; return 0 ;}// DWORD winapi ospf_threadproc (lpvoid lpparam) {// _ tprintf (_ T (" info: ospf_task has been created! \ N "); MSG; _ tchar * pinfo = NULL; peekmessage (& MSG, null, wm_user, wm_user, pm_noremove); While (true) {If (getmessage (& MSG, null, 0, 0) // get MSG from Message Queue {Switch (MSG. message) {Case my_msg: pinfo = (_ tchar *) MSG. wparam; _ tprintf (_ T ("OSPF: Recv % s \ n"), pinfo); break ;}}// Delete pinfo; return 0 ;}
# Ifndef _ vrp_h _ # DEFINE _ vrp_h _ # define my_msg wm_user + 100 const int Limit = 20; DWORD winapi rip_threadproc (lpvoid lpparam); DWORD winapi limit (lpvoid lpparam)