[python-win32] Extending Vista/Windows7 with Python

Stormy StormDragoness at stormweyr.dk
Fri Nov 6 01:41:04 CET 2009


Tim Roberts wrote:
> Stormy wrote:
>   
>> I am trying to implement IPropertyStore in a python component, and run
>> into a few problems.
>>
>> HRESULT GetValue(
>>     REFPROPERTYKEY /key/,
>>     PROPVARIANT */pv/
>> );
>> The GetValue method passes a pointer in the form of an integer to
>> python instead of a key.
>>     
>
> Correct.  REFPROPERTYKEY is a pointer to the key.  You will probably
> have to use something like ctypes to dereference the pointer and fetch
> the actual key.
>
>   
Found I needed an update to my python distribution for ctypes to load 
properly.
Ok, I've constructed the PROPERTYKEY structure using ctypes, and I am 
now successfully fetching sensible data from this pointer
>> And secondly the return value never makes it back to windows either.
>>     
>
> What are you actually returning?
>
>   
I am trying to return a string, however I am not sure if there is 
automatic wrapping of this in a PROPVARIANT as this is the expected 
return value.
The python version of GetValue only accepts the key as an argument.,
I am unsure how to proceed.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-win32/attachments/20091106/2e772743/attachment-0001.htm>


More information about the python-win32 mailing list