push 22
push 22

Reputation: 1182

windows IPropertyStore handler extension doesn't return property values

I'm trying to write a property handler for a file type our product creates I'm mostly there but the handler is failing to return any data via IPropertyStore::GetValue.

I can see via tracing/debugging that the Initialise method is being called and filling the store up with values.

But I can see that whenever GetValue is called although the key is being found in the store the variant has no data in it! if at that point I do something like:

 InitPropVariantFromString(L"BLANK", pPropVar);

into the outval then it all works and BLANK will appear on the InfoTip.

Curiously if I write a test app that uses SHGetPropertyStoreFromParsingName and ask for the property I get the correct data back.

bit stumped really, anyone?

TIA

Upvotes: 2

Views: 530

Answers (1)

push 22
push 22

Reputation: 1182

Fixed - my stupid.

I was defining my property keys incorrectly. Its appears that the whole property key union needs "filling"

like so

const PROPERTYKEY PK_TING={{0x96892702, 0xc272, 0x4792, 0xa2, 0x7, 0xdf, 0xe7, 0xd5, 0x60, 0xd6, 0xb8}, THE_PID};

is using both the guid and the pid of the PROPERTYKEY UNION.

sweetasanut.

Upvotes: 1

Related Questions