On Mar 26, 2012, at 3:20 PM, Tim Roberts wrote:
> Scott Leerssen wrote:
>> I'm trying to write a DWORD value to the registry using _winreg.SetValueEx
>> and anything greater than 0x7fffffff yields a "ValueError: Could not convert
>> the data to the specified type." I've seen a few posts saying that taking
>> the complement of the large integer (basically making it a negative value)
>> satisfies the API and fools it into storing the value, but that has the same
>> result in my experiments. Any hints as to how to write large integers int a
>> DWORD?
>
> Ugly but functional:
> dw = struct.unpack('l',struct.pack('L', 0x80102030))[0]
It looks like I need to employ the inverse of that when reading large values
back out of the registry, since a simple QueryValueEx() on that value is a
negative integer.
_______________________________________________
python-win32 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-win32