Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

"IsDestinationReachable" on Win9x/Win ME

Posted on 2002-06-21
4
Medium Priority
?
339 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 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

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
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…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

636 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