Click here to Skip to main content
15,897,371 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: C++ : pass a string array to LPARAM Pin
Richard MacCutchan27-Aug-12 21:24
mveRichard MacCutchan27-Aug-12 21:24 
AnswerRe: C++ : pass a string array to LPARAM Pin
Maximilien27-Aug-12 9:22
Maximilien27-Aug-12 9:22 
AnswerRe: C++ : pass a string array to LPARAM Pin
CPallini27-Aug-12 9:43
mveCPallini27-Aug-12 9:43 
GeneralRe: C++ : pass a string array to LPARAM Pin
pasztorpisti27-Aug-12 10:32
pasztorpisti27-Aug-12 10:32 
GeneralRe: C++ : pass a string array to LPARAM Pin
CPallini27-Aug-12 21:10
mveCPallini27-Aug-12 21:10 
GeneralRe: C++ : pass a string array to LPARAM Pin
Atlence28-Aug-12 9:02
Atlence28-Aug-12 9:02 
QuestionRe: C++ : pass a string array to LPARAM Pin
CPallini28-Aug-12 9:59
mveCPallini28-Aug-12 9:59 
AnswerRe: C++ : pass a string array to LPARAM Pin
Atlence28-Aug-12 10:28
Atlence28-Aug-12 10:28 
std::list<std::basic_string<TCHAR> > m_lsFiles;

HRESULT CCSheetExt::Initialize (LPCITEMIDLIST pidlFolder, LPDATAOBJECT pDataObj, HKEY hProgID )
{
TCHAR     szFile [MAX_PATH];
UINT      uNumFiles;
HDROP     hdrop;
FORMATETC etc = { CF_HDROP, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
STGMEDIUM stg;

    // Read the list of items from the data object.  They're stored in HDROP
    // form, so just get the HDROP handle and then use the drag 'n' drop APIs
    // on it.
    if ( FAILED( pDataObj->GetData ( &etc, &stg )))
        return E_INVALIDARG;

    // Get an HDROP handle.
    hdrop = (HDROP) GlobalLock ( stg.hGlobal );

    if ( NULL == hdrop )
        {
        ReleaseStgMedium ( &stg );
        return E_INVALIDARG;
        }

    // Determine how many files are involved in this operation.
    uNumFiles = DragQueryFile ( hdrop, 0xFFFFFFFF, NULL, 0 );
    for ( UINT uFile = 0; uFile < uNumFiles; uFile++ )
        {
        // Get the next filename.
        if ( 0 == DragQueryFile ( hdrop, uFile, szFile, MAX_PATH ))
            continue;

        // Add the filename to our list of files to act on.
        m_lsFiles.push_back ( szFile );
        }   // end for

    // Release resources.
    GlobalUnlock ( stg.hGlobal );
    ReleaseStgMedium ( &stg );

    // If we found any files we can work with, return S_OK.  Otherwise,
    // return E_FAIL so we don't get called again for this right-click
    // operation.
    return ( m_lsFiles.size() > 0 ) ? S_OK : E_FAIL;
}

HRESULT CCSheetExt::AddPages (LPFNADDPROPSHEETPAGE lpfnAddPageProc, LPARAM lParam )
{
PROPSHEETPAGE  psp;
HPROPSHEETPAGE hPage;
TCHAR          szPageTitle [MAX_PATH];
string_list::const_iterator it, itEnd;
          
		LoadString (hModuleInstance,IDS_PROJNAME,szPageTitle,sizeof(szPageTitle));
		szPageTitle[24] = '\0';

        psp.dwSize      = sizeof(PROPSHEETPAGE);
        psp.dwFlags     = PSP_USEREFPARENT | PSP_USETITLE | PSP_DEFAULT |
                            PSP_USECALLBACK;
        psp.hInstance   = hModuleInstance;
        psp.pszTemplate = MAKEINTRESOURCE(IDD_PROPPAGE);
	psp.pszIcon     = 0; 
        psp.pszTitle    = szPageTitle;
        psp.pfnDlgProc  = PropPageDlgProc;
        psp.lParam      = (LPARAM) &m_lsFiles;
        psp.pfnCallback = PropPageCallbackProc;
        psp.pcRefParent = (UINT*) &_Module.m_nLockCnt;

        hPage = CreatePropertySheetPage ( &psp );

        if ( NULL != hPage )
            {
            // Call the shell's callback function, so it adds the page to
            // the property sheet.
            if ( !lpfnAddPageProc ( hPage, lParam ))
                {
                DestroyPropertySheetPage ( hPage );
                }
            }

    return S_OK;
}

BOOL OnInitDialog ( HWND hwnd, LPARAM lParam )
{        
PROPSHEETPAGE*  ppsp = (PROPSHEETPAGE*) lParam;
string_list*  pszFile = (string_list*) ppsp->lParam;
HANDLE          hFind;
WIN32_FIND_DATA rFind;

	string_list::const_iterator it;

	it = pszFile->begin();
	CCOMString File=it->c_str();
	MessageBox (0, File, "Tests", 0);

}

QuestionRe: C++ : pass a string array to LPARAM Pin
CPallini28-Aug-12 22:58
mveCPallini28-Aug-12 22:58 
AnswerRe: C++ : pass a string array to LPARAM Pin
Atlence29-Aug-12 7:29
Atlence29-Aug-12 7:29 
AnswerRe: C++ : pass a string array to LPARAM Pin
Stefan_Lang27-Aug-12 23:08
Stefan_Lang27-Aug-12 23:08 
Questionhow to send a slider's value while scrolling.? Pin
mbatra3127-Aug-12 2:41
mbatra3127-Aug-12 2:41 
AnswerRe: how to send a slider's value while scrolling.? Pin
Chris Losinger27-Aug-12 3:18
professionalChris Losinger27-Aug-12 3:18 
AnswerRe: how to send a slider's value while scrolling.? Pin
pasztorpisti27-Aug-12 4:27
pasztorpisti27-Aug-12 4:27 
Questionneed help with vector<student*>* students pointer Pin
neodeaths27-Aug-12 0:28
neodeaths27-Aug-12 0:28 
AnswerRe: need help with vector* students pointer Pin
Maximilien27-Aug-12 0:45
Maximilien27-Aug-12 0:45 
QuestionRe: need help with vector* students pointer Pin
David Crow27-Aug-12 2:34
David Crow27-Aug-12 2:34 
AnswerRe: need help with vector* students pointer Pin
Stefan_Lang27-Aug-12 23:30
Stefan_Lang27-Aug-12 23:30 
Questionfrom sync TCP/IP to async Pin
bkelly1326-Aug-12 15:42
bkelly1326-Aug-12 15:42 
AnswerRe: from sync TCP/IP to async Pin
pasztorpisti26-Aug-12 22:25
pasztorpisti26-Aug-12 22:25 
GeneralRe: from sync TCP/IP to async Pin
bkelly1327-Aug-12 2:41
bkelly1327-Aug-12 2:41 
GeneralRe: from sync TCP/IP to async Pin
pasztorpisti27-Aug-12 4:24
pasztorpisti27-Aug-12 4:24 
GeneralRe: from sync TCP/IP to async Pin
jschell27-Aug-12 8:24
jschell27-Aug-12 8:24 
QuestionAccessing extra keys on a PS2 mouse without driver Pin
David Gvozdenovic26-Aug-12 4:57
David Gvozdenovic26-Aug-12 4:57 
AnswerRe: Accessing extra keys on a PS2 mouse without driver Pin
pasztorpisti26-Aug-12 5:41
pasztorpisti26-Aug-12 5:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.