CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: 2kaud

Search: Search took 0.05 seconds.

  1. Replies
    13
    Views
    2,876

    Re: List Control Column data

    In your find file code you are also not closing the find handle when finished. This will cause a resource leak. Once all the file names have been obtained then the handle should be closed as in


    ...
  2. Replies
    13
    Views
    2,876

    Re: List Control Column data

    Whoops, sorry - I've had a long day and brain is frazzled! Doing it this way you don't need to allocate memory as that would cause a memory leak! You just need lvi.pszText = data2.cFileName. My...
  3. Replies
    13
    Views
    2,876

    Re: List Control Column data

    Why are you using LPSTR_TEXTCALLBACK? If all you are trying to do is to populate a list box with file names then this can be done directly without using callback.



    void CThisDlg::OnOK()
    {...
  4. Replies
    13
    Views
    2,876

    Re: List Control Column data

    Looking back at your original code, you're got another problem.



    struct testing
    {
    char* strFileName;

    };
    ...
  5. Replies
    13
    Views
    2,876

    Re: List Control Column data

    If you allocate memory for node on the heap by using new, then you will need to deallocate that memory once you are finished with it using delete otherwise you will have a memory leak.
  6. Replies
    13
    Views
    2,876

    Re: List Control Column data

    As node is now an auto structure on the stack its address can't be used as an element of lvi as the address will be invalid when OnGetdispinfoList1 is called. A quick and dirty workaround for this is...
  7. Replies
    13
    Views
    2,876

    Re: List Control Column data

    pDispInfo->item.pszText needs to be a pointer to the text. You don't copy the text itself - you just set pszText to point to the start of the text to be stored. I don't know the structure of testing...
Results 1 to 7 of 7





Click Here to Expand Forum to Full Width

Featured