Solved

VB.Net - VB6 convert DNSClient Code

Posted on 2014-02-14
6
348 Views
Last Modified: 2014-02-28
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.SimpleDNSClient.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.SimpleDNSClient.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
0
Comment
Question by:Jimbo99999
  • 4
  • 2
6 Comments
 
LVL 5

Expert Comment

by:advfinance
ID: 39858906
oDNS.ServerAddresses

Open in new window

will probably be an instance of a class type. Find out what the default property is for that class and change
oDNS.ServerAddresses = "555.555.55.55"

Open in new window

to use that property. So if the default property is "Value", change that line to
oDNS.ServerAddresses.Value = "555.555.55.55"

Open in new window

.

If that works, repeat for the other lines with warnings.

--
Chris
0
 

Author Comment

by:Jimbo99999
ID: 39874068
Thanks for responding Chris.  I am finally able to get back to this project and I will try out your suggestions.

Thanks,
jimbo99999
0
 

Author Comment

by:Jimbo99999
ID: 39882654
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.SimpleDNSClient.1")
Dim strFoundIPaddress
oDNS.ServerAddresses = "555.555.55.55"
oDNS.Separator = ", "
On Error Resume Next
oDNS.Resolve "Test.com", strFoundIPaddress, "C_IN", "T_A"
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 5

Accepted Solution

by:
advfinance earned 500 total points
ID: 39885192
I was wrong, I found the source code for the component you're using (http://www.codeguru.com/cpp/i-n/internet/dns/article.php/c6173/Simple-DNS-Resolver-v15.htm from http://www.codeguru.com/cpp/i-n/internet/dns/article.php/c6173/Simple-DNS-Resolver-v15.htm - not sure if it's the same version you're using). "ServerAddresses" is just a string property of the SimpleDNSClient class. Does the code actually run?

--
Chris
0
 

Author Comment

by:Jimbo99999
ID: 39891887
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
0
 

Author Closing Comment

by:Jimbo99999
ID: 39895008
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
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question