DnsQuery_A Return handling

This is a discussion on DnsQuery_A Return handling within the Windows Programming forums, part of the Platform Specific Boards category; Hi I'm using DnsQuery_A Code: DnsQuery_A("hotmail.com" DNS_TYPE_MX, DNS_QUERY_STANDARD, NULL, &pRecordList, NULL); From here : http://msdn.microsoft.com/library/de...s/dnsquery.asp Returns success confirmation upon successful ...

  1. #1
    Registered User
    Join Date
    Mar 2004
    Posts
    161

    DnsQuery_A Return handling

    Hi I'm using DnsQuery_A

    Code:
    DnsQuery_A("hotmail.com"
                   DNS_TYPE_MX,
                   DNS_QUERY_STANDARD,
                   NULL,
                   &pRecordList,
                   NULL);
    From here : http://msdn.microsoft.com/library/de...s/dnsquery.asp
    Returns success confirmation upon successful completion. Otherwise, returns the appropriate DNS-specific error code as defined in Winerror.h.
    But it's still messed up in my mind.. how can I check for a success?

    Thanx
    Last edited by BianConiglio; 08-15-2005 at 05:00 PM.
    This forum is the best one I've ever seen. Great ppl, great coders

  2. #2
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    Posts
    2,544
    Returns success confirmation upon successful completion.
    That is a rather unhelpful statement! A quick check reveals that it returns NOERROR (0) on success and one of the Win32 error codes on failure. Specifically, one of the DNS error codes. You may be interested in this post.
    Code:
    if ( NOERROR == DnsQuery_A("hotmail.com"
                   DNS_TYPE_MX,
                   DNS_QUERY_STANDARD,
                   NULL,
                   &pRecordList,
                   NULL) )
    {
        // success!
    }

  3. #3
    Registered User
    Join Date
    Mar 2004
    Posts
    161
    thanx a lot
    This forum is the best one I've ever seen. Great ppl, great coders

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How can I make this code more elegant?
    By ejohns85 in forum C++ Programming
    Replies: 3
    Last Post: 04-02-2009, 09:55 AM
  2. Another weird error
    By rwmarsh in forum Game Programming
    Replies: 4
    Last Post: 09-24-2006, 11:00 PM
  3. Why only 32x32? (OpenGL) [Please help]
    By Queatrix in forum Game Programming
    Replies: 2
    Last Post: 01-23-2006, 02:39 PM
  4. problem with open gl engine.
    By gell10 in forum Game Programming
    Replies: 1
    Last Post: 08-21-2003, 05:10 AM
  5. opengl code not working
    By Unregistered in forum Windows Programming
    Replies: 4
    Last Post: 02-14-2002, 10:01 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21