Results 1 to 33 of 33

Thread: Parse text file or xml into listboxes

Hybrid View

  1. #1
    PowerPoster
    Join Date
    Jul 2006
    Location
    Maldon, Essex. UK
    Posts
    6,334

    Re: Parse text file or xml into listboxes

    You might see some performance improvements using SendMessage toadd the items to the listboxes
    eg
    Code:
    Option Explicit
    
    Private Const LB_ADDSTRING = &H180
    Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
                    (ByVal hwnd As Long, _
                     ByVal wMsg As Long, _
                     ByVal wParam As Long, _
                     lParam As Any) As Long
    Private lngRet As Long
    
        'Loop through the node list and fill the listboxes
        For Each objNode In objNodeList
            'Get the zip code
            Set oNode = objNode.selectSingleNode("Code")
            lngRet = SendMessage(lstZip.hwnd, LB_ADDSTRING, 0&, ByVal oNode.Text)
            
            'Get the Longitude
            Set oNode = objNode.selectSingleNode("Longitude")
            lngRet = SendMessage(lstLong.hwnd, LB_ADDSTRING, 0&, ByVal oNode.Text)
            
            'Get the Latitude
            Set oNode = objNode.selectSingleNode("Latitude")
            lngRet = SendMessage(lstLat.hwnd, LB_ADDSTRING, 0&, ByVal oNode.Text)
        Next

  2. #2

    Thread Starter
    Frenzied Member ice_531's Avatar
    Join Date
    Aug 2002
    Location
    Sitting w/ Bob Status: -Next -To- Null- Friend: Philip
    Posts
    1,152

    Re: Parse text file or xml into listboxes

    Quote Originally Posted by Doogle View Post
    You might see some performance improvements using SendMessage toadd the items to the listboxes
    eg
    Code:
    Option Explicit
    
    Private Const LB_ADDSTRING = &H180
    Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
                    (ByVal hwnd As Long, _
                     ByVal wMsg As Long, _
                     ByVal wParam As Long, _
                     lParam As Any) As Long
    Private lngRet As Long
    
        'Loop through the node list and fill the listboxes
        For Each objNode In objNodeList
            'Get the zip code
            Set oNode = objNode.selectSingleNode("Code")
            lngRet = SendMessage(lstZip.hwnd, LB_ADDSTRING, 0&, ByVal oNode.Text)
            
            'Get the Longitude
            Set oNode = objNode.selectSingleNode("Longitude")
            lngRet = SendMessage(lstLong.hwnd, LB_ADDSTRING, 0&, ByVal oNode.Text)
            
            'Get the Latitude
            Set oNode = objNode.selectSingleNode("Latitude")
            lngRet = SendMessage(lstLat.hwnd, LB_ADDSTRING, 0&, ByVal oNode.Text)
        Next

    I'll give it a try later and do some timed tests to see. It may speed up some.

    thanks for the idea.
    :::`DISCLAIMER`:::
    Do NOT take anything i have posted to be truthful in any way, shape or form.
    Thank You!

    --------------------------------
    "Never heard about "hiking" poles. I usualy just grab a stick from the nature, and use that as a pole." - NoteMe
    "Finaly I can look as gay as I want..." - NoteMe
    Languages: VB6, BASIC, Java, C#. C++

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