O'Reilly logo

VB Shell Programming by J.P. Hamilton

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Namespace Interfaces

There are four primary interfaces that must be implemented when working with a namespace extension. These are:

  • IPersistFolder

  • IShellFolder

  • IShellView

  • IEnumIDList

Let’s briefly discuss these interfaces. We’ll go into more detail as we implement each one.

IPersistFolder

This interface is used to initialize shell folder objects. This interface contains one method inherited from IPersist, GetClassID, and one native method called Initialize. Initialize is used when the contents of the folder need a fully qualified PIDL in relation to the junction point of the extension. These methods are described in Table 11.1.

Table 11-1. IPersistFolder Methods

Method

Description

GetClassID

Returns the CLSID of the object implementing IPersistFolder.

Initialize

Instructs the object to initialize itself based on the PIDL that is passed in by the shell.

The IDL for IPersistFolder is shown in Example 11.1.

Example 11-1. IPersistFolder

typedef [public] long CLSID;
typedef [public] long LPCITEMIDLIST;

[
    uuid(000214ea-0000-0000-c000-000000000046),
    helpstring("IPersistFolder Interface"),
    odl
]	
interface IPersistFolder : IUnknown
{
    // IPersist methods 
    HRESULT GetClassID([in, out] CLSID *lpClassID);

    // IPersistFolder methods 
    HRESULT Initialize([in] LPCITEMIDLIST pidl);
}

GetClassID

This method returns the CLSID of the object implementing IPersistFolder. This method is inherited from IPersist, and its syntax is as follows:

HRESULT GetClassID( CLSID*pClassID);

Its single parameter ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required