// Select the directory
CHAR PATHNAME [MAX_PATH];
Browseinfo Bi;
bi.hwndowner = null;
Bi.PIDLROOT = NULL;
bi.pszdisplayName = pathname;
Bi.lpsztitle = "Specifies the directory where book data is stored:";
Bi.ulflags = Bif_Returnonlyfsdirs;
bi.lpfn = null;
LpitemidList PIDL = SHBROWSEFORFOLDER (& BI);
IF (PIDL! = NULL)
{
IF (ShgetPathFromidList (PIDL, Pathname))
{
LPMalloc PMalloc;
Shgetmalloc (& pmalloc);
PMalloc-> Free (PIDL);
SDATAPATH = Pathname;
m_reg.writestring (_T ("DataPath"), SDATAPATH);
}
}