Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
RegSetValueEx
Message
From
10/09/1998 15:08:34
 
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Title:
Miscellaneous
Thread ID:
00135140
Message ID:
00135176
Views:
11
George:
I passed it both with and without an @ preceding my variable.

code changes follow:

DECLARE Integer RegSetValueEx IN Win32API ;
Integer hKey, String lpszValueName, Integer dwReserved,;
Integer fdwType, Integer lpbData, Integer cbData


PROCEDURE SetKeyValue
* This routine sets a key value
* Note: this routine only handles data strings (REG_SZ)
LPARAMETER cValueName,cValue
LOCAL nValueSize,nErrCode

*!* DO CASE
*!* CASE TYPE("THIS.nCurrentKey")#'N' OR THIS.nCurrentKey = 0
*!* RETURN ERROR_BADKEY
*!* CASE TYPE("m.cValueName") #"C" OR TYPE("m.cValue")#"C"
*!* RETURN ERROR_BADPARM
*!* CASE EMPTY(m.cValueName) OR EMPTY(m.cValue)
*!* RETURN ERROR_BADPARM
*!* ENDCASE

* Make sure we null terminate this guy
*!* cValue = m.cValue+CHR(0)
*!* nValueSize = LEN(m.cValue)
m.nValueSize = 1
set step on
* Set the key value here
*!* m.nErrCode = RegSetValueEx(THIS.nCurrentKey,m.cValueName,0,;
*!* REG_DWORD,m.cValue,m.nValueSize)

*!* m.nErrCode = RegSetValueEx(THIS.nCurrentKey,m.cValueName,0,;
*!* REG_DWORD,@m.cValue,m.nValueSize)


m.nErrCode = RegSetValueEx(THIS.nCurrentKey,m.cValueName,0,;
REG_DWORD,0x1,1)


set step on
* Check for error
IF m.nErrCode # ERROR_SUCCESS
RETURN m.nErrCode
ENDIF

RETURN ERROR_SUCCESS
ENDPROC


Any ideas?
Mike
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform