Jimbo99999
asked on
VB.Net - VB6 convert DNSClient Code
Good Day Experts!
I have converted a VB6 project to VB 2005 and there was some code conversion I am having trouble with.
VB6
Dim oDNS
Set oDNS = CreateObject("Emmanuel.Sim pleDNSClie nt.1")
Dim strFoundIPaddress
oDNS.ServerAddresses = "555.555.55.55"
oDNS.Separator = ", "
On Error Resume Next
oDNS.Resolve "Test.com", strFoundIPaddress, "C_IN", "T_A"
Converted 2005
Dim oDNS As Object
oDNS = CreateObject("Emmanuel.Sim pleDNSClie nt.1")
Dim strFoundIPaddress As Object
'UPGRADE_WARNING: Couldn't resolve default property of object
oDNS.ServerAddresses = "555.555.55.55"
'UPGRADE_WARNING: Couldn't resolve default property of object oDNS.Separator. oDNS.Separator = ", "
'UPGRADE_WARNING: Couldn't resolve default property of object
On Error Resume Next
oDNS.Resolve.oDNS.Resolve( "Test.com" , strFoundIPaddress, "C_IN", "T_A")
I have searched the net for assistance but I didn't find anything.
Do you have any suggestions that may help me out?
Thanks,
jimbo99999
I have converted a VB6 project to VB 2005 and there was some code conversion I am having trouble with.
VB6
Dim oDNS
Set oDNS = CreateObject("Emmanuel.Sim
Dim strFoundIPaddress
oDNS.ServerAddresses = "555.555.55.55"
oDNS.Separator = ", "
On Error Resume Next
oDNS.Resolve "Test.com", strFoundIPaddress, "C_IN", "T_A"
Converted 2005
Dim oDNS As Object
oDNS = CreateObject("Emmanuel.Sim
Dim strFoundIPaddress As Object
'UPGRADE_WARNING: Couldn't resolve default property of object
oDNS.ServerAddresses = "555.555.55.55"
'UPGRADE_WARNING: Couldn't resolve default property of object oDNS.Separator. oDNS.Separator = ", "
'UPGRADE_WARNING: Couldn't resolve default property of object
On Error Resume Next
oDNS.Resolve.oDNS.Resolve(
I have searched the net for assistance but I didn't find anything.
Do you have any suggestions that may help me out?
Thanks,
jimbo99999
ASKER
Thanks for responding Chris. I am finally able to get back to this project and I will try out your suggestions.
Thanks,
jimbo99999
Thanks,
jimbo99999
ASKER
Hello Chris:
I look for the reference you mentioned( instance of a class) in the code but did not find it.
The above code was just at the top of a subroutine in the VB6 version:
Dim oDNS
Set oDNS = CreateObject("Emmanuel.Sim pleDNSClie nt.1")
Dim strFoundIPaddress
oDNS.ServerAddresses = "555.555.55.55"
oDNS.Separator = ", "
On Error Resume Next
oDNS.Resolve "Test.com", strFoundIPaddress, "C_IN", "T_A"
I look for the reference you mentioned( instance of a class) in the code but did not find it.
The above code was just at the top of a subroutine in the VB6 version:
Dim oDNS
Set oDNS = CreateObject("Emmanuel.Sim
Dim strFoundIPaddress
oDNS.ServerAddresses = "555.555.55.55"
oDNS.Separator = ", "
On Error Resume Next
oDNS.Resolve "Test.com", strFoundIPaddress, "C_IN", "T_A"
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Good Day
The code runs but it I am not getting the IP Address in the strFoundIPaddress variable.
I guess I am not really understanding why/what the oDNS.Resolve is trying to resolve.
Why can't they just put the IP Address in there or is it not known...I don't know.
Thanks,
jimbo99999
The code runs but it I am not getting the IP Address in the strFoundIPaddress variable.
I guess I am not really understanding why/what the oDNS.Resolve is trying to resolve.
Why can't they just put the IP Address in there or is it not known...I don't know.
Thanks,
jimbo99999
ASKER
Thanks for your help. It was determinied that I do not need to use the block of code. However, I appreciate the links you included...they will be a nice addition to my knowledge base.
Thanks,
jimbo99999
Thanks,
jimbo99999
Open in new window
will probably be an instance of a class type. Find out what the default property is for that class and changeOpen in new window
to use that property. So if the default property is "Value", change that line toOpen in new window
.If that works, repeat for the other lines with warnings.
--
Chris