Click here to Skip to main content
15,893,266 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: what's the equivalent of LoadIcon for text file? Pin
berndg28-Nov-02 19:53
berndg28-Nov-02 19:53 
GeneralRe: what's the equivalent of LoadIcon for text file? Pin
devvvy29-Nov-02 17:16
devvvy29-Nov-02 17:16 
QuestionWhere can I find guides on VSS? Pin
George228-Nov-02 18:50
George228-Nov-02 18:50 
AnswerRe: Where can I find guides on VSS? Pin
Ravi Bhavnani29-Nov-02 12:10
professionalRavi Bhavnani29-Nov-02 12:10 
GeneralRe: Where can I find guides on VSS? Pin
George229-Nov-02 18:36
George229-Nov-02 18:36 
GeneralRe: Where can I find guides on VSS? Pin
Ravi Bhavnani30-Nov-02 4:39
professionalRavi Bhavnani30-Nov-02 4:39 
GeneralRe: Where can I find guides on VSS? Pin
George230-Nov-02 16:28
George230-Nov-02 16:28 
GeneralWinsock gethostbyaddr problem Pin
Shamoon28-Nov-02 18:26
Shamoon28-Nov-02 18:26 
I know the ip address of a host and i want to know the name of that host. For this purpose i am using following code:

<code>struct hostent *hp;



     unsigned int addr = inet_addr(m_strHost);

 hp = gethostbyaddr((char *)&addr,4,AF_INET);

 if (hp == NULL )
 {
 printf("\n Failed: %d",WSAGetLastError());
 }

 else
 {
 printf( "%s\n\n", hp->h_name );
 }</code>


It is working fine for my LAN that uses ip address of type 192.x.x.x. But the problem occurs when i give the ip address of host over internet. As such sometimes gethostbyaddr is successful and in most cases it fails. It fails with error 11004 (i.e A blocking Windows Socket 1.1 call was canceled through WSACancelBlockingCall)

Strange that it is happening in office and not at home. Any idea ??? Or any other alternative way to determine host name when ip address is known ???

Strange that it is not failing in all cases. For example, the ipaddress of yahoo.com is: 64.58.79.230. If i give this ip address then, the program runs successful and the hostname returned as: w1.rc.vip.dcx.yahoo.com

But if i give the ip address: 207.219.70.31 (which is that of codeproject.com), then i get error 11004, and gethostbyaddr returns NULL
GeneralRe: Winsock gethostbyaddr problem Pin
Rickard Andersson2029-Nov-02 3:09
Rickard Andersson2029-Nov-02 3:09 
GeneralNeed help in removing element in std::map ! Pin
bahruddina28-Nov-02 15:20
bahruddina28-Nov-02 15:20 
GeneralRe: Need help in removing element in std::map ! Pin
Scott H. Settlemier28-Nov-02 16:27
Scott H. Settlemier28-Nov-02 16:27 
GeneralUnresolved symbol CLSID_SQLOLEDB Pin
paulb28-Nov-02 14:41
paulb28-Nov-02 14:41 
GeneralChanging a view in an SDI. Pin
VanHlebar28-Nov-02 14:32
VanHlebar28-Nov-02 14:32 
GeneralRe: Changing a view in an SDI. Pin
Anatari28-Nov-02 15:15
Anatari28-Nov-02 15:15 
GeneralRe: Changing a view in an SDI. Pin
VanHlebar29-Nov-02 7:40
VanHlebar29-Nov-02 7:40 
GeneralRe: Changing a view in an SDI. Pin
deffer1-Dec-02 17:50
deffer1-Dec-02 17:50 
GeneralRe: Changing a view in an SDI. Pin
valikac28-Nov-02 17:30
valikac28-Nov-02 17:30 
GeneralOpening a new document Pin
Andrew Bleakley28-Nov-02 12:50
Andrew Bleakley28-Nov-02 12:50 
GeneralRe: Opening a new document Pin
valikac28-Nov-02 17:33
valikac28-Nov-02 17:33 
GeneralRe: Opening a new document Pin
Roger Allen29-Nov-02 2:24
Roger Allen29-Nov-02 2:24 
GeneralRe: Opening a new document Pin
Jamie Hale29-Nov-02 9:04
Jamie Hale29-Nov-02 9:04 
GeneralClassWizard Not Working Properly Pin
Steven M Hunt28-Nov-02 11:29
Steven M Hunt28-Nov-02 11:29 
GeneralRe: ClassWizard Not Working Properly Pin
Anatari28-Nov-02 15:13
Anatari28-Nov-02 15:13 
GeneralFloating CControlbar Question ... Pin
Maximilien28-Nov-02 11:19
Maximilien28-Nov-02 11:19 
GeneralRe: Floating CControlbar Question ... Pin
Maximilien29-Nov-02 3:25
Maximilien29-Nov-02 3:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.