How to easily install the latest Delphi?

My delphi application throw runtime error by opening COM1 through MSCOMM32.OCX?

  • my delphi application designed to work with mscomm32.ocx to operate with serial port like com1 or com2 . i have two problem : 1- by installing on a new machine , my application throw runtime error . because mscomm32.ocx hasn't design time lience . yes , there is no design time licence , because this type of lience is not necessary to runtime . now , i want to know how can i install mscomm32.ocx with design time licence or how can i catch this runtime error and continue running application without any problem ? 2-another problem appear in receiving data through mscomm32.ocx ! when mode is set to binary , applcation can't read zero (null) byte from MSCOMM buffer and throw a runtime error ?!?!?!?! unfortunately , mode should be set to binary . A lot of thanks to anyone who help me to solve these problems ....

  • Answer:

    Why you use damn mscomm32.ocx to acess the COM1 ? you can easily access to COM1 without any library/external file with this commands: function OpenCom:Integer; var h:THandle; ct:TCommTimeouts; dcb:TDCB; begin Result:=0; h:=CreateFile ( 'COM1' , GENERIC_WRITE + GENERIC_READ , 0, ni l,OPEN_EXISTING, 0, 0); if (GetLastError = ERROR_ACCESS_DENIED) or (GetLastError = ERROR_FILE_NOT_FOUND) then exit; GetCommTimeouts(h,ct); ct.ReadIntervalTimeout:=MAXDWORD; ct.ReadTotalTimeoutMultiplier:=MAXDWOR… ct.ReadTotalTimeoutConstant:=50; SetCommTimeouts(h,ct); GetCommState(h,dcb); dcb.Parity:=NOPARITY; dcb.DCBlength:=sizeof(_dcb); dcb.BaudRate:=CBR_9600; dcb.StopBits:=ONESTOPBIT; dcb.ByteSize:=8; SetCommState(h,dcb); Result:=h; end;

Alfered1... at Yahoo! Answers Visit the source

Was this solution helpful to you?

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.