Solved

"IsDestinationReachable" on Win9x/Win ME

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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

Suggested Solutions

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…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
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…

756 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