n="justify"> {;
/ * Handle the error. * /
}
/ * Fill in the DCB: baud=9600, 8 data bits, no parity, 2 stop bit. * /. BaudRate=9600;. ByteSize=8;. Parity=NOPARITY;. StopBits=TWOSTOPBITS;=SetCommState (hCom, & dcb); (! FSuccess)
{;
/ * Handle the error. * /
} (hCom, & TimeOuts);. ReadIntervalTimeout=100;. ReadTotalTimeoutMultiplier=1;. ReadTotalTimeoutConstant=100; (hCom, & TimeOuts); long g=1; work1 [2], work2 [2]; (! Terminated)
{= ReadFile (hCom, work1, g, & g, 0); ((fSuccess) && (g> 0))
{
{= ReadFile (hCom, work2, g, & g, 0); ((fSuccess) && (g> 0))
{[index]=work1 [0] | (work2 [0] << 8); + +; (index == 16)
{();=0;
}
}
} while ((fSuccess) && (g> 0));
}
} (hCom);
}
/ / ---------------------------------------------------------------------------
Файл: MyRC.cpp
/ / ---------------------------------------------------------------------------
# include
# pragma hdrstop («MyRC.res»); («RC.cpp», MainForm); («Sites.cpp», SitesForm); («FrictSites.cpp», FrictSitesForm); («DataModule.cpp», DM);/* TDataModule: DesignClass * / («RCs.cpp», RCForm); («KPT.cpp», KPTForm);(«GlobalVariables.cpp»);(«SerialLink.cpp»);(«Report.cpp», ReportForm);
//---------------------------------------------------------------------------WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
{> Initialize ();> CreateForm (__classid (TDM), & DM);> CreateForm (__classid (TMainForm), & MainForm);> CreateForm (__classid (TSitesForm ), & SitesForm);> CreateForm (__classid (TFrictSitesForm), & FrictSitesForm);> CreateForm (__classid (TRCForm), & RCForm);> CreateForm (__classid (TKPTForm), & KPTForm);> ; CreateForm (__classid (TReportForm), & ReportForm);> Run ();
} (Exception & exception)
{> ShowException (& exception);
} 0;
}
/ / ---------------------------------------------------------------------------