Link to home
Start Free TrialLog in
Avatar of ChLa
ChLaFlag for United States of America

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
Avatar of ste5an
ste5an
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ChLa

ASKER

Hi,
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.
Avatar of ChLa

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  ?
Did you read the readme of the comport library ?
Avatar of ChLa

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.
Avatar of ChLa

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.