View previous topic :: View next topic |
Author |
Message |
Barry
Joined: 27 May 2005 Posts: 5
|
Posted: Wed Aug 17, 2005 2:50 am Post subject: STDCALL and FTN95 |
|
|
I am writing a FTN95 application which uses ClearWin to produce a GUI (hence there are call-back functions in the program). The program uses several STDCALL statements to set up function calls to a DLL which is supplied by the manufacturer of an interface card which the application is controlling.
Where do I put the STDCALL statements? Should they be all in the main program (i.e. before ClearWin calls the call-back functions) or should they be repeated in each call-back function (assuming that this has a reference within it to a particular DLL function)?
Barry Chambers |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7930 Location: Salford, UK
|
Posted: Mon Aug 22, 2005 12:49 am Post subject: STDCALL and FTN95 |
|
|
If you are accessing a DLL that uses the STDCALL protocol then all you need is /IMPORT_LIB <DLL path> on the FTN95 command line. You can do this using Plato and the properties of a Reference in the Propject Explorer window.
Your own code does not need any modification. |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7930 Location: Salford, UK
|
Posted: Fri Aug 26, 2005 2:59 am Post subject: STDCALL and FTN95 |
|
|
Thank you for your email.
This is to confirm my original reply.
The normal way to access a DLL that uses STDCALL is to use /IMPORT_LIB
<dll_name> alone.
This will lookup all function calls in the DLL and do everything for you.
If /IMPORT_LIB fails to work as intended then it will be necessary to
provide a STDCALL declaration in each external subprogram for every function
call (to the DLL) in the subprogram. The simplest way to do this is to
create an INCLUDE file for all the declarations. An alternative would be to
try using a MODULE to declare the relevant functions.
|
|
Back to top |
|
|
Barry
Joined: 27 May 2005 Posts: 5
|
Posted: Fri Aug 26, 2005 10:43 am Post subject: STDCALL and FTN95 |
|
|
Paul
Many thanks
Barry |
|
Back to top |
|
|
|