Silverfrost Forums

Welcome to our forums

STDCALL and FTN95

17 Aug 2005 1:50 #269

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

21 Aug 2005 11:49 #273

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.

26 Aug 2005 1:59 #283

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.

26 Aug 2005 9:43 #285

Paul

Many thanks

Barry

Please login to reply.