Note that there are some explanatory texts on larger screens.

plurals
  1. POgethostbyname win32 error
    text
    copied!<p>I am using the gethostbyname() function in the usual manner...</p> <pre><code>iaHost.s_addr = inet_addr(lpServerName); if (iaHost.s_addr == INADDR_NONE) { // Wasn't an IP address string, assume it is a name lpHostEntry = 0; lpHostEntry = gethostbyname(lpServerName); } </code></pre> <p>to access my web site and return information. The variable, "lpServerName", can be any host, e.g., "google.com" or the loop-back, "127.0.0.1".</p> <p>My system: Windows x64 or x32 (it doesn't matter the same error occurs) running on an AMD Opteron system, XAMPP is on my machine and I use it for debugging purposes, my compiler is Microsoft Visual c++ 2005.</p> <p>Here's the problem: when I use the loop-back address, the code above works fine. When I try and access a web site exterior to my computer I get the following error: "Windows has triggered a breakpoint in test_gethostbyname.exe. This may be due to a corruption of the heap, and indicates a bug in test_gethostbyname.exe or any of the DLLs it has loaded. The output window may have more diagnostic information". The program, "test_gethostbyname.exe", contains only the parts of the code from a much larger project that apply to accessing the internet. Thus, I don't think the heap is being corrupted by anything I have done. I have tried the "getaddrinfo" command with the same results. I have searched the web for any kind of information on this problem with no joy (other than segmentation faults on unix systems).</p> <p>Does anyone know of any problem with this command that would cause this error to occur? </p> <p>Thanks in advance,</p> <p>Jay</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload