资源简介

基本的图像检索系统 用到MFC和openCV

资源截图

代码片段和文件信息

// DirDialog.cpp: implementation of the CDirDialog class.
//
//////////////////////////////////////////////////////////////////////

#include “stdafx.h“
#include “DirDialog.h“

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif


// Callback function called by SHBrowseForFolder‘s browse control
// after initialization and when selection changes
int __stdcall CDirDialog::BrowseCtrlCallback(HWND hwnd UINT uMsg LPARAM lParam LPARAM lpData)
{
    CDirDialog* pDirDialogObj = (CDirDialog*)lpData;
    if (uMsg == BFFM_INITIALIZED )
    {
        if( ! pDirDialogObj->m_strSelDir.IsEmpty() )
            ::SendMessage(hwnd BFFM_SETSELECTION TRUE (LPARAM)(LPCTSTR)(pDirDialogObj->m_strSelDir));
        if( ! pDirDialogObj->m_strWindowtitle.IsEmpty() )
            ::SetWindowText(hwnd (LPCTSTR) pDirDialogObj->m_strWindowtitle);
    }
    else if( uMsg == BFFM_SELCHANGED )
    {
        LPITEMIDLIST pidl = (LPITEMIDLIST) lParam;
        char selection[MAX_PATH];
        if( ! ::SHGetPathFromIDList(pidl selection) )
            selection[0] = ‘\0‘;

        CString csStatusText;
        BOOL bOk = pDirDialogObj->SelChanged(selection csStatusText);

        if( pDirDialogObj->m_bStatus )
            ::SendMessage(hwnd BFFM_SETSTATUSTEXT  0 (LPARAM)(LPCSTR)csStatusText);

        ::SendMessage(hwnd BFFM_ENABLEOK 0 bOk);
    }
  return 0;
}

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CDirDialog::CDirDialog()
{
m_bStatus = FALSE;
}

CDirDialog::~CDirDialog()
{

}


BOOL CDirDialog::DoBrowse(CWnd *pwndParent)
{

    if( ! m_strSelDir.IsEmpty() )
    {
        m_strSelDir.TrimRight();
        if( m_strSelDir.Right(1) == “\\“ || m_strSelDir.Right(1) == “//“ )
            m_strSelDir = m_strSelDir.Left(m_strSelDir.GetLength() - 1);
    }

    LPMALLOC pMalloc;
    if (SHGetMalloc (&pMalloc)!= NOERROR)
        return FALSE;

    BROWSEINFO bInfo;
    LPITEMIDLIST pidl;
    ZeroMemory ( (PVOID) &bInfosizeof (BROWSEINFO));

    if (!m_strInitDir.IsEmpty ())
    {
        OLECHAR       olePath[MAX_PATH];
        ULONG         chEaten;
        ULONG         dwAttributes;
        HRESULT       hr;
        LPSHELLFOLDER pDesktopFolder;
        //
        // Get a pointer to the Desktop‘s IShellFolder interface.
        //
        if (SUCCEEDED(SHGetDesktopFolder(&pDesktopFolder)))
        {
            //
            // IShellFolder::ParseDisplayName requires the file name be in Unicode.
            //
            MultiByteToWideChar(CP_ACP MB_PRECOMPOSED m_strInitDir.GetBuffer(MAX_PATH) -1
                                olePath MAX_PATH);

            m_strInitDir.ReleaseBuffer (-1);
            //
            // Convert the path to an ITEMIDLIST.
            //
            hr = pDesktop

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件     217600  2012-10-23 19:49  MF0933038谢朋峻\RETRIEVAL_2_3\Debug\RETRIEVAL_2_3.exe

     文件    1255132  2012-10-23 19:49  MF0933038谢朋峻\RETRIEVAL_2_3\Debug\RETRIEVAL_2_3.ilk

     文件    4123648  2012-10-23 19:49  MF0933038谢朋峻\RETRIEVAL_2_3\Debug\RETRIEVAL_2_3.pdb

     文件       6000  2012-10-23 19:49  MF0933038谢朋峻\RETRIEVAL_2_3\RETRIEVAL_2_3\Debug\BuildLog.htm

     文件      21854  2012-10-16 21:44  MF0933038谢朋峻\RETRIEVAL_2_3\RETRIEVAL_2_3\Debug\DirDialog.obj

     文件         65  2012-10-23 19:49  MF0933038谢朋峻\RETRIEVAL_2_3\RETRIEVAL_2_3\Debug\mt.dep

     文件        920  2012-10-23 19:49  MF0933038谢朋峻\RETRIEVAL_2_3\RETRIEVAL_2_3\Debug\RETRIEVAL_2_3.exe.embed.manifest

     文件        984  2012-10-23 19:49  MF0933038谢朋峻\RETRIEVAL_2_3\RETRIEVAL_2_3\Debug\RETRIEVAL_2_3.exe.embed.manifest.res

     文件        861  2012-10-23 19:49  MF0933038谢朋峻\RETRIEVAL_2_3\RETRIEVAL_2_3\Debug\RETRIEVAL_2_3.exe.intermediate.manifest

     文件      82036  2012-10-16 21:44  MF0933038谢朋峻\RETRIEVAL_2_3\RETRIEVAL_2_3\Debug\RETRIEVAL_2_3.obj

     文件   25296896  2012-10-16 21:44  MF0933038谢朋峻\RETRIEVAL_2_3\RETRIEVAL_2_3\Debug\RETRIEVAL_2_3.pch

     文件      24388  2012-10-16 21:44  MF0933038谢朋峻\RETRIEVAL_2_3\RETRIEVAL_2_3\Debug\RETRIEVAL_2_3.res

     文件     732630  2012-10-16 21:44  MF0933038谢朋峻\RETRIEVAL_2_3\RETRIEVAL_2_3\Debug\RETRIEVAL_2_3Dlg.obj

     文件     464135  2012-10-16 21:44  MF0933038谢朋峻\RETRIEVAL_2_3\RETRIEVAL_2_3\Debug\stdafx.obj

     文件    1207296  2012-10-16 21:44  MF0933038谢朋峻\RETRIEVAL_2_3\RETRIEVAL_2_3\Debug\vc90.idb

     文件    2486272  2012-10-16 21:44  MF0933038谢朋峻\RETRIEVAL_2_3\RETRIEVAL_2_3\Debug\vc90.pdb

     文件       4511  2010-02-05 14:58  MF0933038谢朋峻\RETRIEVAL_2_3\RETRIEVAL_2_3\DirDialog.cpp

     文件        968  2010-02-05 02:12  MF0933038谢朋峻\RETRIEVAL_2_3\RETRIEVAL_2_3\DirDialog.h

     文件       4130  2010-02-03 13:11  MF0933038谢朋峻\RETRIEVAL_2_3\RETRIEVAL_2_3\ReadMe.txt

     文件      21630  2003-07-23 17:52  MF0933038谢朋峻\RETRIEVAL_2_3\RETRIEVAL_2_3\res\RETRIEVAL_2_3.ico

     文件        404  2010-02-03 13:11  MF0933038谢朋峻\RETRIEVAL_2_3\RETRIEVAL_2_3\res\RETRIEVAL_2_3.rc2

     文件       1099  2010-02-05 20:52  MF0933038谢朋峻\RETRIEVAL_2_3\RETRIEVAL_2_3\resource.h

     文件      44424  2012-10-25 20:06  MF0933038谢朋峻\RETRIEVAL_2_3\RETRIEVAL_2_3\RETRIEVAL_2_3.APS

     文件       2175  2010-02-03 13:11  MF0933038谢朋峻\RETRIEVAL_2_3\RETRIEVAL_2_3\RETRIEVAL_2_3.cpp

     文件        546  2010-02-03 13:11  MF0933038谢朋峻\RETRIEVAL_2_3\RETRIEVAL_2_3\RETRIEVAL_2_3.h

     文件       6934  2010-02-05 20:52  MF0933038谢朋峻\RETRIEVAL_2_3\RETRIEVAL_2_3\RETRIEVAL_2_3.rc

     文件       5760  2010-02-22 14:14  MF0933038谢朋峻\RETRIEVAL_2_3\RETRIEVAL_2_3\RETRIEVAL_2_3.vcproj

     文件       1415  2012-10-28 21:38  MF0933038谢朋峻\RETRIEVAL_2_3\RETRIEVAL_2_3\RETRIEVAL_2_3.vcproj.easion-PC.easion.user

     文件       1409  2010-02-22 14:30  MF0933038谢朋峻\RETRIEVAL_2_3\RETRIEVAL_2_3\RETRIEVAL_2_3.vcproj.xpj-PC.xpj.user

     文件       9145  2010-02-06 15:00  MF0933038谢朋峻\RETRIEVAL_2_3\RETRIEVAL_2_3\RETRIEVAL_2_3Dlg.cpp

............此处省略145个文件信息

评论

共有 条评论