Click to See Complete Forum and Search --> : Infinite Loop in For oXMLobject.selectNodes when migrate to VB.NET


ptran12001
April 8th, 2008, 01:19 PM
I used the VS2005 migration wizard to migrate a VB6 program to VB.Net. The following snippets of the For loop codes executes once through the loop in VB6, but was in the infinite loop when the codes were migrated to VB.NET. Any suggestion would be appreciated.

Private oXMLobject As New MSXML2.DOMDocument

Dim objNode As MSXML2.IXMLDOMNode
Dim versionInfo As String

versionInfo = ""

oXMLobject = Nothing
oXMLobject = New MSXML2.DOMDocument40
oXMLobject.async = False
oXMLobject.Load(tramFlNm)

For Each objNode In oXMLobject.selectNodes("trademark-applications-daily/version")

versionInfo = objNode.xml

Next objNode

dglienna
April 8th, 2008, 01:48 PM
Search and you shall find:

http://www.codeproject.com/KB/cpp/parsefilecode.aspx

The wizard is only about 90% useful, and doesn't do 100% conversion, as you may have realized.

Odds are you can do things a lot better using net then the wizard will do for you.