Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Calling a DLL
Message
De
19/08/1998 18:02:04
 
 
À
19/08/1998 17:43:45
Information générale
Forum:
Visual FoxPro
Catégorie:
FoxPro 2.x
Titre:
Divers
Thread ID:
00128301
Message ID:
00128308
Vues:
25
>Hello all..
>
>this may sound like a dumb question, but could someone tell me how to call a .DLL from a foxpro 2.6 program? I have tried to use the SET LIBRARY TO, but I get an error "LIBARY FILE IS INVALID" when I try to use the winsock.dll library. What am I missing here?
>
>Thanks
>
>steven
>
>webmaster@meadewillis.com


You can't SET LIBRARY TO a .DLL file. You can only do that to .FLL files. To call other .DLL's you can:

SET LIBRARY TO (SYS(2004) + 'foxtools.fll') ADDITIVE

and use the REGFN and CALLFN functions in that.
*
* From FPAdvisor 9/95
*
PUBLIC m.reglodcur, m.regsetcur, m.reggetcur, m.oldcur, m.ibeamcur
*
* IDC_IBEAM represents the predefined shape for the text insertion icon
* used by the mouse cursor
*
#DEFINE IDC_IBEAM (32513)
*
* register the LoadCursor(),SetCursor(), and GetCursor() functions
* found within the Windows api
*
m.callfn = 'CALLFN'
m.regfn = 'REGFN'
M.REGLODCUR=®FN.("LoadCursor","IL","I")
M.REGSETCUR=®FN.("SetCursor","I","I")
M.REGGETCUR=®FN.("GetCursor","","I")
*
* get the handle for the text cursor icon so that we can compare later on
*
M.OLDCUR=&CALLFN.(M.REGSETCUR,CALLFN(M.REGLODCUR,0,IDC_IBEAM))
M.IBEAMCUR=&CALLFN.(M.REGGETCUR)
=&CALLFN.(REGSETCUR,M.OLDCUR)


I hope that's not too confusing. The & is used on the REGFN and the CALLFN so that the Project Manager won't complain about not finding functions of those names (they're in FOXTOOLS.FLL). I think there's a document in the UT files section explaining FOXTOOLS.

Another thing to be aware of. I don't think you can call a 32 bit .DLL from FPW2.6. I might be wrong about that. Don't use 2.6 much anymore.
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform