if port is not found add unc path and check againĮlse if (GetDefaultCommConfig(PChar('\\. If (GetDefaultCommConfig(PChar(l_port),CommConfig,size)) then ![]() If (RightStr(l_port,1) = ':') then l_port := LeftStr(l_port,Length(l_port)-1) įillChar(CommConfig, SizeOf(TCommConfig), 0) ĬommConfig.dwSize := sizeof(TCommConfig) strip trailing : as it does not work with it The first 4 are valid but return 1200 and the 5th is invalid and returns 0 function ComPort(l_port:String):TCommConfig įillChar(Result, SizeOf(TCommConfig), 0) //blank return valueĬomFile := CreateFile(PortName,GENERIC_READ or GENERIC_WRITE,0,nil,OPEN_EXISTING,0įillChar(Result, SizeOf(TCommConfig), 0) Serial Port In Delphi 7 Download 0 Comments Download Setup File Download Delphi 7 Enterprise Full Crack Delphi 7 Enterprise Full Crack Delphi 7 is a powerful integrated development environment (IDE) that developed by Borland, working for console, desktop, web, and mobile applications. I have tried calling it like so: ComPort('com1') The code below looks like it is working, but the baud rate is always 1200, which looking in windows device manager (and altering port settings), is wrong. ![]() The problem is the function I wote returns the wrong values. ![]() Hi I have the need to find the Baud rate and other settings for a serial port, Looking about on the web, it looks like I should be using GetCommConfig, This returns a TCommConfig record with what I assume is the data I need.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |