Public Types | Public Member Functions

ShellFolder Struct Reference

IShellFolder smart pointer. More...

#include <shellclasses.h>

Inheritance diagram for ShellFolder:
Inheritance graph
[legend]
Collaboration diagram for ShellFolder:
Collaboration graph
[legend]

List of all members.

Public Types

typedef IShellFolderPtr super

Public Member Functions

 ShellFolder ()
 ShellFolder (IShellFolder *p)
 ShellFolder (IShellFolder *parent, LPCITEMIDLIST pidl)
 ShellFolder (LPCITEMIDLIST pidl)
void attach (IShellFolder *parent, LPCITEMIDLIST pidl)
String get_name (LPCITEMIDLIST pidl=NULL, SHGDNF flags=SHGDN_NORMAL) const
bool empty () const

Detailed Description

IShellFolder smart pointer.

Definition at line 555 of file shellclasses.h.


Member Typedef Documentation

Definition at line 557 of file shellclasses.h.


Constructor & Destructor Documentation

ShellFolder::ShellFolder (  )

Definition at line 194 of file shellclasses.cpp.

References CHECKERROR, and CONTEXT.

{
    CONTEXT("ShellFolder::ShellFolder()");

    IShellFolder* desktop;

    CHECKERROR(SHGetDesktopFolder(&desktop));

    super::Attach(desktop);
    desktop->AddRef();
}
ShellFolder::ShellFolder ( IShellFolder *  p )

Definition at line 206 of file shellclasses.cpp.

References CONTEXT.

 :  super(p)
{
    CONTEXT("ShellFolder::ShellFolder(IShellFolder*)");

    p->AddRef();
}
ShellFolder::ShellFolder ( IShellFolder *  parent,
LPCITEMIDLIST  pidl 
)

Definition at line 214 of file shellclasses.cpp.

References CHECKERROR, and CONTEXT.

{
    CONTEXT("ShellFolder::ShellFolder(IShellFolder*, LPCITEMIDLIST)");

    IShellFolder* ptr;

    if (!pidl)
        CHECKERROR(E_INVALIDARG);

    if (pidl && pidl->mkid.cb)
        CHECKERROR(parent->BindToObject(pidl, 0, IID_IShellFolder, (LPVOID*)&ptr));
    else
        ptr = parent;

    super::Attach(ptr);
    ptr->AddRef();
}
ShellFolder::ShellFolder ( LPCITEMIDLIST  pidl )

Definition at line 232 of file shellclasses.cpp.

References CHECKERROR, CONTEXT, and GetDesktopFolder().

{
    CONTEXT("ShellFolder::ShellFolder(LPCITEMIDLIST)");

    IShellFolder* ptr;
    IShellFolder* parent = GetDesktopFolder();

    if (pidl && pidl->mkid.cb)
        CHECKERROR(parent->BindToObject(pidl, 0, IID_IShellFolder, (LPVOID*)&ptr));
    else
        ptr = parent;

    super::Attach(ptr);
    ptr->AddRef();
}

Here is the call graph for this function:


Member Function Documentation

void ShellFolder::attach ( IShellFolder *  parent,
LPCITEMIDLIST  pidl 
)

Definition at line 248 of file shellclasses.cpp.

References CHECKERROR, and CONTEXT.

{
    CONTEXT("ShellFolder::attach(IShellFolder*, LPCITEMIDLIST)");

    IShellFolder* ptr;

    if (pidl && pidl->mkid.cb)
        CHECKERROR(parent->BindToObject(pidl, 0, IID_IShellFolder, (LPVOID*)&ptr));
    else
        ptr = parent;

    super::Attach(ptr);
    ptr->AddRef();
}
bool ShellFolder::empty (  ) const [inline]

Definition at line 567 of file shellclasses.h.

Referenced by ShellDirectory::get_path().

{return !operator bool();}  //NOTE: see SIfacePtr::empty()

Here is the caller graph for this function:

String ShellFolder::get_name ( LPCITEMIDLIST  pidl = NULL,
SHGDNF  flags = SHGDN_NORMAL 
) const

Definition at line 320 of file shellclasses.cpp.

References CHECKERROR, CONTEXT, COUNTOF, StrRet, and TEXT.

Referenced by StartMenu::AddEntry(), BookmarkList::import_IE_favorites(), ShellBrowser::Init(), and ShellDirectory::ShellDirectory().

{
    CONTEXT("ShellFolder::get_name()");

    TCHAR buffer[MAX_PATH];
    StrRet strret;

    HRESULT hr = ((IShellFolder*)*const_cast<ShellFolder*>(this))->GetDisplayNameOf(pidl, flags, &strret);

    if (hr == S_OK)
        strret.GetString(pidl->mkid, buffer, COUNTOF(buffer));
    else {
        CHECKERROR(hr);
        *buffer = TEXT('\0');
    }

    return buffer;
}

Here is the caller graph for this function:


The documentation for this struct was generated from the following files:

ROS Explorer Source Code Documentation
generated on 02.01.2013 by doxygen

ROS Explorer Homepage