?
Solved

"IsDestinationReachable" on Win9x/Win ME

Posted on 2002-06-21
4
Medium Priority
?
344 Views
Last Modified: 2013-12-04
Has anybody an idea why "IsDestinationReachable" doesn't work on Win9x/Win ME? It just returns FALSE.

MSIE 5.0 is installed on those machines and I'm able to ping the server I pass to "IsDestinationReachable". Also "GetLastError" returns ERROR_SUCCESS.
0
Comment
Question by:searching
  • 2
3 Comments
 

Author Comment

by:searching
ID: 7098311
development environment: an MFC project in MSVC 6.0 SP5/ Win2000 SP2 / Platform SDK November 2001 Edition / MSIE 5.0
0
 
LVL 32

Accepted Solution

by:
jhance earned 600 total points
ID: 7098670
Show your code.  I think you are making a programming error.  I tested this on Win2000, XP, and WinME and it works as expected on all platforms.

My code:

int main(int argc, char* argv[])
{
     QOCINFO mQOC;
     mQOC.dwSize = sizeof(QOCINFO);

     printf("IsDestinationReachable() Test\n\n");

     if(argc < 2){
          printf("usage: ReachableTest <hostname_or_ip>\n");
          return -1;
     }

     if(IsDestinationReachable(argv[1], &mQOC)){
          // Returned TRUE
          printf("IsDestinationReachable() SUCCEEDED.\n");
          printf("\tdwFlags\t\t: 0x%08X\n", mQOC.dwFlags);
          printf("\tdwInSpeed\t: %d\n", mQOC.dwInSpeed);
          printf("\tdwOutSpeed\t: %d\n", mQOC.dwOutSpeed);

     }
     else{
          // Returned FALSE - ERROR
          printf("IsDestinationReachable() failed.  Error is: %d\n", GetLastError());
          return -1;
     }

     return 0;
}

On all Windows platforms I get:

C:\ReachableTest\Release>ReachableTest www.experts-exchange.com

IsDestinationReachable() Test

IsDestinationReachable() SUCCEEDED.
        dwFlags         : 0x00000001
        dwInSpeed       : 100000000
        dwOutSpeed      : 100000000
0
 

Author Comment

by:searching
ID: 7103182
Tnx for pointing this out. I have tested a few things and it seems that "IsDestinationReachable" behaves differently on Win9x <-> Win2000.
Win2000: "http://www.experts-exchange.com" OK
         "www.experts-exchange.com" OK
Win9x: "http://www.experts-exchange.com" NOT OK
       "www.experts-exchange.com" OK

I've also tested "InternetCheckConnection". Do you have any experiences with this function? It crashes or returns FALSE on platforms with WinInet.dll 5.00.26xx.xx or lower.
Any suggestions?
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

This article shows a few slightly more advanced techniques for Windows 7 gadget programming, including how to save and restore user settings for your gadget and how to populate the "details" panel that is displayed in the Windows 7 gadget gallery.  …
This article describes how to programmatically preset the "Pages per Sheet" option that's available with most printer drivers.   This setting lets you do "n-Up" printing, where two, four, or more pages are printed on each sheet of paper. If your …
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

850 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