關閉範例

當點擊 X 以離開範例時將呼叫 Stop,此將停止 EtherCAT 網路及 KINGSTAR 子系統,接著呼叫 Destroy 將關閉 KINGSTAR 子系統的連結並終止子系統。

void CMFC_GUIDlg::OnClose()
{	
   ::Stop();      //Stops the EtherCAT network and the KINGSTAR Subsystem.
   ::Destroy();   //Closes the link to the KINGSTAR Subsystem and terminates the Subsystem.
   if (CanExit())
      CDialogEx::OnClose();
}