Solved

"IsDestinationReachable" on Win9x/Win ME

Posted on 2002-06-21
4
254 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
4 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 200 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

This tutorial is about how to put some of your C++ program's functionality into a standard DLL, and how to make working with the EXE and the DLL simple and seamless.   We'll be using Microsoft Visual Studio 2008 and we will cut out the noise; that i…
This article shows how to make a Windows 7 gadget that accepts files dropped from the Windows Explorer.  It also illustrates how to give your gadget a non-rectangular shape and how to add some nifty visual effects to text displayed in a your gadget.…
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…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

759 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

24 Experts available now in Live!

Get 1:1 Help Now