Solved

VB.Net - VB6 convert DNSClient Code

Posted on 2014-02-14
6
325 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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

708 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now