Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    New to the CF scene
    Join Date
    Apr 2004
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy Filling in List control with default values?

    Hi, in my windows prog I have a list control and would like to fill it in with two default values. my list control holds a list of file paths that can be modified with an ADD and a REMOVE button. Here is the code for the ADD operation:


    Code:
    void CDlgDlg::OnAddTexPath()
    {
    	BROWSEINFO bi;
    	ZeroMemory(&bi, sizeof(BROWSEINFO));
    
    	bi.hwndOwner = m_hWnd;
    	bi.ulFlags   = BIF_RETURNONLYFSDIRS;
    
    	LPITEMIDLIST pidl = SHBrowseForFolder(&bi);
    
    	BOOL bRet = FALSE;
    
    	TCHAR szFolder[MAX_PATH*2];
    	szFolder[0] = _T('\0');
    
    	if (pidl)
    	{
    		if (SHGetPathFromIDList(pidl, szFolder))
    		{
    			bRet = TRUE;
    		}
    
    		IMalloc *pMalloc = NULL;
    		if (SUCCEEDED(SHGetMalloc(&pMalloc)) && pMalloc)
    		{
    			pMalloc->Free(pidl);
    			pMalloc->Release();
    		}
    	}
    
    	wm_texList.InsertItem(wm_texList.GetItemCount(), szFolder);
    }
    How would I, for example, display the two following default values in my list control?

    "c:\dfsd\nbnb"
    "e:\dhfjdhfj\dgfhdgh"

    Thanks for your help

    Last edited by Keermalec; 04-29-2004 at 07:23 PM.


 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •