Thursday, November 19, 2009

IShellFolderViewCB Is Not Optional

When writing a Shell Namespace Extension with DefView it is important to realize that IShellFolderViewCB is not optional for proper updates of the DefView.

If you construct your DefView like this:

::SHCreateShellFolderView(pcsfv, (IShellView **)ppvReturn);

One of the parameters of SFV_CREATE is psfvcb which points to an instance of IShellFolderViewCB.  IShellFolderViewCB is a callback interface that you can use to get notified of what is happening in the DefView.

If you don’t care what DefView is doing it is tempting to leave it NULL.  However, if you do this the DefView will not update correctly on calls like this:


So always implement a IShellFolderViewCB interface with the minimum functionality when using the DefView.


No comments:

Post a Comment