Visual FOX PRO

Support for the Milan Intelligent interface, sold by Money Controls as the Paylink USB unit and for the earlier PCI card version.

Moderators: aardvark, davebush, Admin

Post Reply
vilosh
Posts: 21
Joined: Tue Dec 12, 2006 7:17 pm

Visual FOX PRO

Post by vilosh »

Hi i programing in VFP 9.0,
I not experence with API programatic, with DLL
Do you have any example for controller SR3 and UHopper,
usando Paylink.

I need understand how can i controller with VFP instruccion
How call the funtions of .dll

regards
davebush
Posts: 492
Joined: Fri Oct 22, 2004 12:20 pm

Post by davebush »

Hi,

We don’t have any experience in Visual Foxpro. Having looked rount the web, you need to check out the DECLARE INTEGER command.

If you look in the AesImhei.h C header file in the SDK folder, you will see a list of the DLL calls.

The C line:

Code: Select all

long DLL SwitchOpens (long SwitchNumber) ;
will translate into

Code: Select all

DECLARE INTEGER SwitchOpens IN "AesImhei.dll" INTEGER SwitchNumber
(in 32 bit Windows all integers are equivalent to long)

There still remains a problem. In order to be callable from Visual Basic the C DLL functions use the _stdcall keyword. As well as controlling how the stack works, this also causes the Visual C compiler to “decorate” the function name - it alters the actual name generated and used.

We cope with that for Visual Basic by using the ALIAS keyword, which gives VB the exact string that appears in the DLL. The same function in AesImhei.bas is declared as:

Code: Select all

Declare Function SwitchOpens Lib "AesImhei.dll" Alias "_SwitchOpens@4" (ByVal SwitchNumber As Long) As Long
You may be able to get away with:

Code: Select all

DECLARE INTEGER SwitchOpens@4 IN "AesImhei.dll" INTEGER SwitchNumber
but the chances are that the ‘@’ will cause problems.

Dave Bush

If you would like to find the section on DECLARE INTEGER in your documentation, and any references to stdcall or “decoration” and paste them into a reply, I will see if I can work out what we should do.
Aardvark software developer. Please put all communication on the problem through the board for the benefit of others.
Post Reply