Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
MESSAGEBOX() Font
Message
From
11/03/1998 11:42:40
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00083590
Message ID:
00083912
Views:
26
Hi David,

Thanks. I'll take a look at it.
Bill

>Bill,
>
>It's not as bad as it sounds, I think it was Christof did this for someone over on a CSi forum back last fall. The problem is that the VFP samples registry class specifically ignores the REG_BINARY and REG_DWORD key types and this key in particular is type REG_BINARY that's 50 bytes long. I've got a "better" registry class in the works that I'll get posted on my website at some point in time. Here's the 2 relevant methods from my class
>
>
>method _DecodeValue
>lparameter pdwType, pcData, pnData
>
>local luRetVal
>
>luRetVal = .null.
>
>do case
>   case pdwType = REG_SZ
>      luRetVal = left( pcData, pnData-1 )
>
>   case pdwType = REG_DWORD
>      luRetVal = FromLong( pcData )
>
>   case pdwType = REG_BINARY
>      * provide read access to this type, but for registry safety reasons write is not supported
>      luRetVal = left( pcData, pnData )
>
>   otherwise
>      * Don't support anything other types
>endcase
>
>return luRetVal
>
>*method _GetRegValue
>lparameters pcValueName
>* Obtains a value from a registry key
>
>this.mnErrorNum = ERROR_SUCCESS
>
>do case
>   case ( this.mnCurrentKey = 0 )
>      this.mnErrorNum = ERROR_BADKEY
>   case ( type( "pcValueName" ) != "C" )
>      this.mnErrorNum = ERROR_BADPARM
>endcase
>
>if ( this.mnErrorNum != ERROR_SUCCESS )
>   return this.mnErrorNum
>endif
>
>local lpdwReserved, lpdwtype, lcData, lnData
>lpdwReserved = 0
>lpdwtype = REG_NONE
>lcData = space( this.mnMaxValueDataLen )
>lnData = len( lcData )
>
>this.mnErrorNum = RegQueryValueEx( this.mnCurrentKey, pcValueName, lpdwReserved, @lpdwType, ;
>                                   @lcData, @lnData )
>
>if ( this.mnErrorNum = ERROR_SUCCESS )
>   this.mnKeyType = lpdwType
>   this.muKeyValue = this._DecodeValue( lpdwType, lcData, lnData )
>endif
>
>return this.mnErrorNum
>

>
>>Sounds kinda ugly. :-) Ok. Thanks,
William A. Caton III
Software Engineer
MAXIMUS
Atlanta, Ga.
Previous
Reply
Map
View

Click here to load this message in the networking platform