|
-
Jul 1st, 2011, 08:07 AM
#1
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
-
Jul 1st, 2011, 08:14 AM
#2
Thread Starter
Frenzied Member
Re: Parse text file or xml into listboxes
 Originally Posted by Doogle
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|