IShellFolder smart pointer. More...
#include <shellclasses.h>


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 |
IShellFolder smart pointer.
Definition at line 555 of file shellclasses.h.
| typedef IShellFolderPtr ShellFolder::super |
Definition at line 557 of file shellclasses.h.
| 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.
| 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();
}

| 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()

| 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;
}

|
ROS Explorer Source Code Documentation
generated on 02.01.2013 by
|