Using the Scanner SDK for windows with Delphi

I have been attempting to use the Motorola Scanner SDK to upgrade our POS software. We have LS9203 barcode scanners attached to our POS terminals via RS232. We are upgrading this software to allow the integration of a merchant terminal (for credit/debit card) on each POS. These merchant terminals require an RS232 connection and since our hardware only has one port available we would like to move the barcode scanner to a USB port. We have purchased the appropriate cable and the scanner appear to test properly with the Motorola utilities.

 

I downloaded and installed the SDK have tested some of the code samples in Microsoft Visual Studio and I do get the expected results.

 

Scanner Response C Code.jpg

 

Our POS software is written in Delphi. I appear to be able to make a connection with the scanner driver but when I issue the GetScanners command I get returned the following:

 

Scanner Response Delphi Code.jpg

I assume that I have made a successful connection with the Open command. The Status code returns as 0. I am passing 1 in the scannerTypes to look for any type of scanner. The numberOfScanners is returning as 0 so it doesn't look like it has found any. My only guess at this point is that even though it looks like I am sending a 1 in scannerTypes, the GetScanners function is actually receiving a different value thereby not actually looking for any type of scanner. This is possibly due to bit order or position in the Delphi type SmallInt versus the C Type Short.

 

Does anyone have any sample code for Delphi? Any assistance would be appreciated.