Frage

I' m new to Delphi and using Delphi 2007, I'm connecting to a Bluetooth printer e and also send data. Referring to post Bluetooth and Delphi and Indy Bluetooth support , I'm trying to load IdBluetooth.pas in my delphi project and get some errors:

1) ULONG, SYSTEMTIME and all other Windows type are not recognized.

sin.port           := ULONG(-1);

2) Undeclared identifier FReuseSocket and otUnix at line 107

if (FReuseSocket = rsTrue) or ((FReuseSocket = rsOSDependent) and (GOSType = otUnix)) then

TdIOHandlerSocket doesn't contain a memeber TdIOhandlerSocket(228 and 311):

Socket.ReuseSocket := FReuseSocket;

I added JWABluetoothA, JWABtHDef, JWABthSdpDef, JWAWinDLLNames, JWAWindows, JWAws2Bth libraries

How could I fix these errors?

Another question: as well as connecting, if I should send any other data to BT device, what procedure should I use?

War es hilfreich?

Lösung

1 - You should probably add the Windows unit to the uses clause to make those types available, then.

2 - You're using Delphi 2007, but the date of the article you linked for Indy Bluetooth Support is dated in mid-2011. It's most likely it was written for a more recent version of Indy than the one that shipped with Delphi 2007; you'll probably have to either upgrade your Indy version or modify the source of Bluetooth.pas to downgrade it to your Indy version.

As far as your "Another question", that would be just that - another (separate) question, since an answer to it now would be meaningless until you can compile Bluetooth.pas successfully.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top