Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using DECLARE DLLs?
Message
From
31/07/1998 16:44:51
 
 
To
31/07/1998 14:29:34
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00123141
Message ID:
00123196
Views:
20
>Can someone explain how and when to use DECLARE DLLs?
>
>I see the following code in the sample Tastrade app and don't
>understand it.
>
>*-- DECLARE DLL statements for reading/writing to private INI files
>DECLARE INTEGER GetPrivateProfileString IN Win32API AS GetPrivStr ;
> String cSection, String cKey, String cDefault, String @cBuffer, ;
> Integer nBufferSize, String cINIFile
>
>Perhaps there are other APIs that I could/should be using. Can
>someone do a better job of explaining them than what is in
>the VFP help file?

Example:

* You have to initialize the string first
lcbufferstring = space(100)+chr(10)
* The function returns the length of the requested value
* and stores the value in LCBUFFERSTRING
lnlenstring = getprivstr("WindowPreferences", ;
"Executive Alias", ;
"", ;
@lcbufferstring, ;
len(lcbufferstring), ;
"EL.INI")
if lnlenstring > 0
lcbufferstring = subs(lcbufferstring,1,lnlenstring)
else
lcbufferstring = ""
endif

In EL.INI:
[WindowPreferences]
Executive Alias=e_main_all

lnlenstring = 10
lcbufferstring = "e_main_all"

Not too tough once you understand what they needs. It helps to put wrappers (either in a class or UDF) around them.

paul
Previous
Reply
Map
View

Click here to load this message in the networking platform