I'm currently building a fruit machine emulator that will pay out 'real' money via a hopper. To communicate with the hopper I'm using a hopper interface card that comes with a DLL and instructions on making it work with Delphi, VB6 and VB.NET.
I'm very new to programming but have been learning C++ and successfully programmed some code that works out how much needs to be paid out.
I need to send this info to the hopper and wondered if I can interface to the DLL in C++? (apologies for my naivety if this is a stupid question).
The instructions for opening the COM port (for instance) in VB6 say:
Declaration in Visual Basic 6: Simply add the DLL import unit 'cashdll.bas' to your project, or add following line to the declarations part: Declare Function HOPPER_OPENCOM Lib "CASH.DLL" (ByVal HOPPER_COMPORT As Long) As Long
The cashdll.bas
file just has this code:
`'HOPPER-Interface
Declare Function HOPPER_OPENCOM Lib "CASH.DLL" (ByVal HOPPER_COMPORT As Long) As Long
Declare Function HOPPER1_PAYOUT Lib "CASH.DLL" (ByVal HOPPER_COINS As Long) As Long
Declare Function HOPPER1_MOTOR_RUN Lib "CASH.DLL" () As Long
Declare Function HOPPER1_MOTOR_STOP Lib "CASH.DLL" () As Long
Declare Function HOPPER1_READ Lib "CASH.DLL" () As Long
Declare Function HOPPER2_PAYOUT Lib "CASH.DLL" (ByVal HOPPER_COINS As Long) As Long
Declare Function HOPPER2_MOTOR_RUN Lib "CASH.DLL" () As Long
Declare Function HOPPER2_MOTOR_STOP Lib "CASH.DLL" () As Long
Declare Function HOPPER2_READ Lib "CASH.DLL" () As Long
Declare Function HOPPER_IN1 Lib "CASH.DLL" () As Long
Declare Sub HOPPER_CLOSECOM Lib "CASH.DLL" ()`
Would there be an equivalent of this in C++ and, if I wrote that into my Visual Studio project and somehow 'included' the DLL would it still operate?
Thanks
(The hopper interface page with more details is here)