What is the secret to understanding MSDN COM documentation?

I am looking for a โ€œtypicalโ€ way to navigate MSDN to get the COM class to do what it wants.

Example problem: I'm looking for an API method to unlock a local file (remove the internet zone / web file label from the file programmatically).

I found one post on stackoverflow.com which talked about clsid_persistentzoneidentifier. so I searched on MSDN and got to http://msdn.microsoft.com/en-us/library/ms537029(VS.85).aspx . What I'm looking for is what he does after they get to this url. From this location, I cannot figure out what the sequence of operations should be. How to connect this IZoneIdentifier to IPersistFile? etc. There must be something basic that I skip over the documentation related to COM. MSDN has interfaces and objects, but nothing helps me visualize the "sequence" diagram. None of this will let me know which COM objects belong to the same class. therefore, there may / or should be QueryInterfaced, adn, which should be CoCreated.

+4
source share
2 answers

The documentation for this points out a few things.

First, you can call CoCreateInstance by passing CLSID_PersistentZoneIdentifier to get the implementation of these two interfaces:

It also says:

Use IPersistFile to attach the object to the target file and IZoneIdentifier examine or manage the zone ID.

In doing so, you can see the documentation for IPersistFile here:

http://msdn.microsoft.com/en-us/library/ms687223(VS.85).aspx

This shows that there is a Load method that you want to call with a file name in order to load an implementation with details about the file.

From there, you can call QueryInterface on IUnknown to get the IZoneIdentifier interface, and then call the Remove method on it to set the zone to the local machine.

+4
source

For this purpose, if this is not obvious from the documentation, I like to find examples of programs that use the appropriate APIs: either using Google, or perhaps from what corresponds to the Microsoft SDK.

Microsoft SDKs, such as this one , include sample programs.

+1
source

All Articles