Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to call DLL & API ????
Message
General information
Forum:
Visual FoxPro
Category:
FoxPro 2.x
Miscellaneous
Thread ID:
00013930
Message ID:
00015007
Views:
43
>>Hello Ahmad,>you are either misspelling the name of your function or missing it.
>>By looking at your code I can say that you are using the wrong sintax.
>>The right sintax is the next:
>>RegFn(FunctionName,ArgTypes,ReturnType,DLLname)
>>
>>and you are using the 'DLL name' in the place of the 'FunctionName',
>>look the file \fpw26\goodies\foxtools\foxtools.wri it exaplains it.
>>In your case your sintaxis should be:
>>
>>opfh=REGFN(FunctionName,"CI","C","c:\aradsk\hook.dll")
>>
>>If you need an actual example let me know.
>>luisg@netrunner.net
>>Hope this help
>>Good luck.
>
>Yes Please send me an actual example...
>
>And there is some thing else ...
>
>We want to call a funtion called "IsCharEnglish(char)"
>located in "c:\arasdk\include\bidi.h"
>and to include the "bidi.h" we have to include first "window.h"
>
>So. how we go about doing that...???
>
>Ahmad

Hi Ahmad,
Here is the example, this function returns the windows resources
available, it uses 'USER.EXE', user.exe is a library and
should be in \Windows\System.

PROCEDURE SysResrc
*** Author: Rick Strahl
*** Function: Returns System Resource percentage
*** Assume: Calls 16-bit USER.EXE function
*** uses FoxTools.fll
*** Pass: pcMethod - "SYSTEM","GDI","USER"
*** Return: numeric percentage or -1 on error
***************************************************
PARAMETERS pcMethod
pcMethod=IIF(type("pcMethod")="C",UPPER(pcMethod),"")
SET LIBRARY TO HOME()+"FOXTOOLS" ADDITIVE

DO CASE
CASE pcMethod ="SYSTEM"
lntype=0
CASE pcMethod = "GDI"
lntype=1
CASE pcMethod = "USER"
lntype=2
OTHERWISE
RETURN -1

ENDCASE
*** /// UINT GetFreeSystemResources(fuSysResource)
*** /// UINT fuSysResource; /* type of resource */

lhSysRes=REGFN("GetFreeSystemResources","I","I","USER.EXE")

RETURN CALLFN(lhSysRes,lnType)

*EOP SysResource
I toke this code from 'Foxpro Advisor', december/95.
If you save this code in a 'PRG' file like resource.prg, then
you can call the function typing this from the command window:

SET PROCEDURE TO resource.prg ADDITIVE
nMy_resources=SysResrc('USER')
?nMy_resources
Your second question, it doesn't matter the order in
which you include the files in your project.
Hope this help.
Good Luck
luisg@netrunner.net
Luis Guzman, MCP
"The only glory most of us have to hope for
is the glory of being normal." Katherine Fulleton Gerould
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform