CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    Dec 2009
    Posts
    17

    listview to text file

    attached are 2 projects 1 is which creates a listview and adds items

    and second is the project which i want to create where in it will read the list view of the first project and put its values in text file separated with commas i m trying a lot but cant get through can any guru help me
    Attached Files Attached Files

  2. #2
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,362

    Re: listview to text file

    Basically you just need to loop through the listview and write the data to a file,
    Always use [code][/code] tags when posting code.

  3. #3
    Join Date
    Dec 2009
    Posts
    17

    Re: listview to text file

    Quote Originally Posted by DataMiser View Post
    Basically you just need to loop through the list view and write the data to a file,
    i have coded but its not happening can u chk sir

  4. #4
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: listview to text file

    Post the CODE, and maybe we might be able to help. Or, maybe, check back on Sunday, and hand it in?
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  5. #5
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,362

    Re: listview to text file

    I do not see any code that even checks to find the listview you want to use, just an enum child windows function that does not really seem to be used for anything at all.

    I do see a lot of code that is much more complicated than it needs to be however code which I might add is not being used at this point.
    Last edited by DataMiser; May 7th, 2010 at 10:33 PM.
    Always use [code][/code] tags when posting code.

  6. #6
    Join Date
    Jul 2006
    Location
    Germany
    Posts
    3,725

    Re: listview to text file

    Sorry, Rohit, you are getting confused a little.
    This sample you have posted does not work, because it does not find the hWnd of the ListView properly, because it is no child of the MDI-titled window.
    I told you and proved already, that the SysListView32ToCSV() routine as you had it works perfectly. I proved it by adding an lvWof ListView to the project and producing a perfect CSV file from it.
    If you go and fix the hWnd searching routine looking for the right window before it looks for the listview child it would work alright.

    Nobody could give you a useful help here unless they had not this Odin-ListView which is giving you the trouble. The routine - as you have it - works with all usual ListViews as soon as you obtain their proper hWnd. So nobody could fix it, because it is good. The problem is that it does not work with a custom drawn ListView as it appears to be in the Odin program you want to read out.

  7. #7
    Join Date
    Sep 2010
    Posts
    5

    Re: listview to text file

    Rohit bhai,

    i am also stuck at the same place. I can read data from other listview but with ODIN SysListView32, i am able to read only column headers. I think it is the same code which u have used. Now have u got any solution for this problem. Can we use memorydump type API call.

    Any other expert may please help us out. Code i am using is attached.

    Thanks.
    Attached Files Attached Files

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured