Welcome to MSDN Blogs Sign in | Join | Help

September 2006 - Posts

Today I'd like to share the fearful tale about a Vista upgrade gone horribly wrong and of my fantastic recovery. Based on a true story... It is a still moonless night when I decide to take the plunge and upgrade my home machine to Windows Vista Ultimate Read More...
As I went through the property helper posts, I kept using those dense word combinations " locale sensitive " and " locale insensitive ". Why? Because locale tells your computer whether to display a number as "5.3" or "5,3". Should "5,305" be a big number Read More...
I'm sorry I haven't posted recently. I've been busy with an apartment search, softball games, and numerous other things that eat up the free time I need to write detailed posts about the property system. For filler, I suppose I'll have to talk about something Read More...
In general, PropVariantCompare performs a locale-sensitive comparison between two values and returns <0, 0, or >0 as appropriate. PropVariantCompare always tries to convert the values to the type of the first value. Thus if code tries to compare Read More...
PropVariantChangeType, aka Mr. Coercion , is the function responsible for all the coercion that goes on in the property system. It takes a value and attempts to output the same value, but as a different type. Thus it will convert L"10" to the number 10 Read More...
One of the more prominent properties is PKEY_Keywords , e.g. "Tags". This is a vector property, and so it usually comes packaged in a PROPVARIANT with VT_VECTOR|VT_LPWSTR . If you deal with properties such as this, you may find the following helpers useful: Read More...
You may have noticed that most of the PROPVARIANT helpers return an HRESULT. This makes them easy to use in conjunction with COM calling patterns like the following: IPropertyStore pps = ... PROPVARIANT propvar = {0}; HRESULT hr = InitPropVariantFromInt32(100, Read More...
Reading a PROPVARIANT seems innocuous, but it suffers from many of the same dangers as does initializating one of these structures . I highly recommend that you instead use the following helpers to aid your code's readability and reduce your error rate. Read More...
PROPVARIANTs are easy to misuse . Because the data members are so cryptic, it is easy to get confused or to overlook errors. To help alleviate these and other problems (including readability), we provide a series of PROPVARIANT helpers for common uses. Read More...
As I mentioned yesterday, PROPVARIANT's hold data that gets piped through the property system. Early in our development cycle, we noticed is that even the most careful developer can easily make mistakes when initializing PROPVARIANTs. One common mistake Read More...
Values in the property system are stored in PROPVARIANT structures. Originally constructed for use in OLE structured storage, the property system reuses this structure to hold its data. As the name suggests, a PROPVARIANT can hold a variety of data. A Read More...
Most of the property system uses PROPERTYKEY s to identify properties. But you can also identify a property using its canonical name. For instance, PKEY_DateModified corresponds to L"System.DateModified". Whereas a PROPERTYKEY was good for coding and Read More...
I mentioned that one of the property system layers coerces values to be of the correct type. But how does the system know the expected type? The property system maintains a data structure describing each property on the machine. Each property description Read More...
Windows APIs often use HRESULT s. Almost every function returns an HRESULT and almost every caller is expected to check it. COM provides a few helpers for these tasks: SUCCEEDED () / FAILED () broadly check for success or for failure; HRESULT_FROM_WIN32 Read More...
I often get this question: "How can I read properties directly from a property handler?" (Remember that the property handler is the file system namespace's extensibility point.) Usually, the person just wants to read one or more properties and doesn't Read More...
It's easy to get confused about what points of extensibility exist and what layer provide what services. This isn't helped by the fact that we've lumped a bunch of things into the property system, but I'll try to diagram this out here and in future posts. Read More...
In my first post , I described what the property system provides from an API perspective. But I used all these techno-wiggle-waggle-jibber-jabber that my friends couldn't follow. Ich. What feedback for a first post! So here it is minus the 133t-speak: Read More...
 
Page view tracker