Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Receiving error on DLL Call

Status
Not open for further replies.

tryn2learn

Programmer
Jun 26, 2000
24
US
I'm new to visual foxpro and I'm trying to call a procedure which resides in a DLL which is written in Delphi. The procedure uses real numbers for some currency fields and requires 24 parameters. In my declare statement I've used SINGLE as the parameter type for those fields defined as real in the procedure. Upon running my visual program it errors out with the message "Declare DLL caused exception". However, If I set step on prior to the call and step through the call it runs without error. Does anyone have any idea what may be causing this? If so, how do I fix it?
 
Hi!

In Delphi "real" type is non-standard and specific only for Delphi. If you write DLL that will be used by other applications written in other languages, never use this type. There are single and Double types in the Delphi too, thata re compartible to the common types used everywhere.

The explanation of behavior: When VFP tries to pass parameters, it pus single values. However, Delphi tries to get them as a real values. This cause weird errors. Sometimes no error, but values of parameters inside Delphi function will be incorrect. This because single and Delphi real types have different format.
Vlad Grynchyshyn
vgryn@softserve.lviv.ua
The professional level of programmer could be determined by level of stupidity of his/her bugs
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top