The Great Flying Tortoise

A hard-boiled look at Win32 C++ programming and the property system
Posts
  • The Great Flying Tortoise

    How I Learned to Stop Worrying and Love the Vista

    • 2 Comments
    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...
  • The Great Flying Tortoise

    PROPVARIANT Helpers #7 - Locale sensitivity and the helper APIs

    • 1 Comments
    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...
  • The Great Flying Tortoise

    Say Cheese!

    • 1 Comments
    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...
  • The Great Flying Tortoise

    PROPVARIANT Helpers #6 - PropVariantCompare[Ex]

    • 2 Comments
    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...
  • The Great Flying Tortoise

    PROPVARIANT Helpers #5 - PropVariantChangeType

    • 2 Comments
    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...
  • The Great Flying Tortoise

    PROPVARIANT Helpers #4 - Vector Helpers

    • 1 Comments
    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...
  • The Great Flying Tortoise

    PROPVARIANT Helpers #3 - Simpler reading functions

    • 0 Comments
    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...
  • The Great Flying Tortoise

    PROPVARIANT Helpers #2 - Reading single values

    • 0 Comments
    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...
  • The Great Flying Tortoise

    PROPVARIANT helpers #1 - Initialization

    • 2 Comments
    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...
  • The Great Flying Tortoise

    PROPVARIANTs - Common mistakes

    • 0 Comments
    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...
  • The Great Flying Tortoise

    Introducing the PROPVARIANT

    • 0 Comments
    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...
  • The Great Flying Tortoise

    Canonical Property Names

    • 1 Comments
    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...
  • The Great Flying Tortoise

    The source of property types

    • 1 Comments
    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...
  • The Great Flying Tortoise

    Surprise! My success is your failure

    • 0 Comments
    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...
  • The Great Flying Tortoise

    Why use IShellItem2::GetPropertyStore?

    • 0 Comments
    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...
  • The Great Flying Tortoise

    Property System Layers and Extensibility Points

    • 4 Comments
    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...
  • The Great Flying Tortoise

    What is the Property System? - in normal language

    • 2 Comments
    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...
Page 1 of 1 (17 items)