ChLa
asked on
Which UNIT do I need to add to uses for 'CloseHandle' ?
I am using Delphi from within Rad Studio 10.2 to write a small program to see exactly how to talk to a device via USB. The device will appear as a Com port. I have a working shell for my program and started to write in the details for how to open, configure, write to, and close a port. I started with close because it is the smallest. I am getting the error message undeclared identifier 'CloseHandle'. Is there a UNIT I need to add to USES ?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for the link. I have read the manual, about 2 decades ago when they used to print them. I was not able to absorb or even understand all of it. But I have been programming successfully with Delphi for a long time. This sort of thing is out of my range of experience and so I sometimes need some help. I haven't compiled .dpk files before.
Which .dpk file(s) do I compile for RAD Studio 10.2 ?
Which .dpk file(s) do I compile for RAD Studio 10.2 ?
Did you read the readme of the comport library ?
ASKER
Yes I did. It is not very explicit regarding Delphi 10.2. My guess is that I need to compile either CPortLibD2010.dpk, or, CPortLibDXE.dpk. My confusion stems from the fact that I don't know if DX refers to Delphi versions later than 2010, or if it refers to a light version of Delphi. I like to be sure about these things so I don't make any mistakes.
DXE means Delphi XE.
Just test it, errors and mistakes are a source of wisdom and knowledge.
Just test it, errors and mistakes are a source of wisdom and knowledge.
ASKER
I compiled, built and installed CPortLibDXE.dpk and DsgnCPortDXE.dpk. Now I have six Cport components in my component library. I just ran the Comport Library example and it is able to communicate with my device. I should be able to continue form here. compiling, building and installing was easy.
thank you very much for your help.
thank you very much for your help.
ASKER
I need help. I am trying to compile the Comport pas file. I have loaded it into Delphi and now I am supposed to hit compile in the package window. I cannot find a package window or a compile button.