views:

169

answers:

2

According to http://msdn.microsoft.com/en-us/library/aa916070.aspx (DnsQuery_W), DNS query libraries are available on Windows Mobile / CE developers for versions 5.0 onwards. Yet, "#include " gives nasty "file not found" errors. What gives? Strangely enough "dnsapi.lib" is available. Does Microsoft actually expect developers to scavenge the file from somewhere?..

+1  A: 

The posted thread here claims that this API is not actually available in Windows Mobile 5 (and perhaps later?), despite claiming otherwise. I looked through the Mobile 5 and 6 SDKs, and didn't see this API either, so perhaps the thread's suggestion might work for you:

If it's a simple host name->IP address (IPv4 or v6), you can use getnameinfo in Winsock. The DNSQuery_W is only needed if you're doing like a non-A/AAAA query. If you're doing that, we really don't have any helpers to do that for you from the OS side - sorry. You may look around to see if there's helper library floating around out there that you may be able to recompile for CE (assuming you're comfortable with whatever licensing agreements they may put on you.)

getnameinfo should be documented here (for Windows Mobile), in case that helps.

Reuben
Ideally I wanted full functionality, but A query should suffice. I already solved the problem using gethostbyname. Thanks!
Ignas Limanauskas
A: 

If you are really after 'windns.h', I found it in the WM5/WM6/WM6.1 Platform Builders in

\public\common\sdk\inc

The hard part is getting access to the WM Platform Builder if your an ISV. That I can't help you with.

Shane Powell