Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with DnsQuery

Status
Not open for further replies.

khilscher

Programmer
Joined
May 28, 2002
Messages
8
Location
CA
I am a C++ newbie. I am writing a MFC dialog app that does a DnsQuery lookup on a FQDN. I'm just starting out by hardcoding the FQDN and such into the DnsQuery function, but I can't even get that to work. Here's what I have so far.

void CDDNSTestAppDlg::OnBtnQuery()
{

CString sFQDN;
WORD wType;
DWORD dwOptions;

sFQDN = "wType = 1;
dwOptions = DNS_QUERY_STANDARD;


DNS_STATUS WINAPI DnsQuery_A (sFQDN,
wType,
dwOptions,
NULL
);
}

I'm getting compiler errors such as "anachronism used" or "too many initializers"

Can someone help?

--Kevin
 
First, it should be so:
void CDDNSTestAppDlg::OnBtnQuery()
{

CString sFQDN;
WORD wType;
DWORD dwOptions;

sFQDN = " wType = 1;
dwOptions = DNS_QUERY_STANDARD;

//this is not a function definition!
DNS_STATUS mydns= DnsQuery_A (sFQDN,
wType,
dwOptions,
NULL
);
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top