- This topic has 21 replies, 4 voices, and was last updated 17 years ago by Admin.
-
AuthorPosts
-
May 8, 2007 at 1:39 am #187939autopilotMember
Hope this clears it up… make the code from your post above part of a function or sub called refreshlistview… then in another sub use something like:
Dim objDocCopy As MSXML2.DOMDocument
private sub XMLCompair()
Dim objDoc As MSXML2.DOMDocument
'load the xml document
Set objDoc = New MSXML2.DOMDocument
objDoc.async = False
objDoc.Load "http://localhost/xmloutput.php"
'compair files
if objDoc objDocCopy then
objDocCopy = objDoc
refreshlistview()
end if
end subyou only want to process the xml if it has changed… so you want to load the web page, check if it has changed, and if it has, make a copy of it and then refresh the listview.
autopilot
May 8, 2007 at 1:50 am #187938methodMemberthanks for your reply. Loading what page?
In Onload event i prepare listview1 and i start the timer and from inside timer i call populatelistview that holds my code. populatelistview reload listview .
So where should i use your code?what should be inside refreshlistview() ?
You never mentioned timer? how then i do the check regulerly?
May 8, 2007 at 12:43 pm #187937autopilotMember@method wrote:
thanks for your reply. Loading what page?
“http://localhost/xmloutput.php”
@method wrote:
In Onload event i prepare listview1 and i start the timer and from inside timer i call populatelistview that holds my code. populatelistview reload listview .
Instead of calling populatelistview from your timer, call XMLCompair from my previous post and from XMLCompair call populatelistview (instead of refreshlistview) if the 2 xml files are different.
@method wrote:So where should i use your code?what should be inside refreshlistview() ?
You never mentioned timer? how then i do the check regulerly?
i never mentioned how to use the timer because i thought you would be able to figure out how to put it together on your own.
autopilot
May 8, 2007 at 3:30 pm #187936methodMemberI already tried what you have suggested before your post but i keep getting this error:
Run-time error 453
object doesn’t support this property or method
pointing at
‘compair files
If objDoc objDocCopy Thenfurthermore,shouldn’t this line:
Dim objDocCopy As MSXML2.DOMDocumentbe outside compair function?
May 8, 2007 at 4:04 pm #187935autopilotMember@method wrote:
furthermore,shouldn’t this line:
Dim objDocCopy As MSXML2.DOMDocument be outside compair function?if you look back up at my post, it is outside the sub @autopilot wrote:
Dim objDocCopy As MSXML2.DOMDocument
private sub XMLCompair()just a note… you may need to dim as new
Dim objDocCopy As New MSXML2.DOMDocument
as far as you getting an error, i am not sure what to tell you… i have never used vb6… i did basic programming a long time ago (15 yrs or more) and just in the last 2 yrs i have started programming with vb 2005… so i dont know what else to tell you…
but i will look at compairing xml files with vb 2005 and see what i can come up with… but the should work (i never tested it though)
autopilot
May 8, 2007 at 5:38 pm #187934autopilotMemberYou may have to use the .innertext to make the compair… try the following:
'compair files
If objDoc.InnerText objDocCopy.InnerText Then
objDocCopy = objDoc
populatelistview()
end ifautopilot
May 8, 2007 at 6:09 pm #187933methodMemberI get this error now:
Compile error:
Method or data member not found
pointing at:
.
InnerText
-
AuthorPosts
Related
- You must be logged in to reply to this topic.