Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Reading From An INI File
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00664506
Message ID:
00665509
Views:
24
George,

I finally got it working. It seems I had the "@" token in the declare in places
it shouldn't have been:
  DECLARE INTEGER RegCreateKeyEx IN Win32API; 
    INTEGER @iBaseKey,;
    STRING  @sSubKey,;
    INTEGER @iReserved,;
    STRING  @iClass,;
    INTEGER @iOptions,;
    INTEGER @iAccess,;
    INTEGER @iSecurity,;
    INTEGER @iHandle,;
    INTEGER @iDisposition
instead of
  DECLARE INTEGER RegCreateKeyEx IN Win32API; 
    INTEGER iBaseKey,;
    STRING  @sSubKey,;
    INTEGER iReserved,;
    STRING  iClass,;
    INTEGER iOptions,;
    INTEGER iAccess,;
    INTEGER iSecurity,;
    INTEGER @iHandle,;
    INTEGER @iDisposition
After that change, I tried:
iBaseKey = HKEY_LOCAL_MACHINE
sSubKey = REG_TEST_KEY
iHandle = 0
iDisposition = 0

? RegCreateKeyEx(iBaseKey, @sSubKey, 0, 0, 0, 0, 0, @iHandle, @iDisposition)
and all works fine now. So that leads me to my next question. Does the "@" token
in the DECLARE mean the value is expected to be passed by reference? And how do
I know when to pass a value by reference to an API call? And finally, Is there
some compelling reason to use the RegCreateKeyEx over RegCreateKey?

Thanks for all your experct help!
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform