Click here to Skip to main content
15,913,854 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: caling an exe from dialog box Pin
7-Apr-02 11:12
suss7-Apr-02 11:12 
GeneralRe: caling an exe from dialog box Pin
Rickard Andersson207-Apr-02 11:32
Rickard Andersson207-Apr-02 11:32 
GeneralIgnoring 20 characters Pin
7-Apr-02 9:27
suss7-Apr-02 9:27 
GeneralRe: Ignoring 20 characters Pin
ColinDavies7-Apr-02 10:05
ColinDavies7-Apr-02 10:05 
GeneralRe: Ignoring 20 characters Pin
Todd Smith7-Apr-02 10:33
Todd Smith7-Apr-02 10:33 
GeneralRe: Ignoring 20 characters Pin
Phil Speller7-Apr-02 12:15
Phil Speller7-Apr-02 12:15 
GeneralResolving Hostname :: MFC Pin
valikac7-Apr-02 9:11
valikac7-Apr-02 9:11 
GeneralRe: Resolving Hostname :: MFC Pin
Phil Speller7-Apr-02 22:48
Phil Speller7-Apr-02 22:48 
I'm afraid that this isn't really an answer, but I use a very similar method to resolve a host name in an MFC app and it works just as expected. However, I do have 2 comments to make:

1. I guess it's just a typo, but your assignment of mIP should read:
mIP = inet_ntoa( *(reinterpret_cast<struct in_addr="" *="">( host->h_addr )) );

2. I use AfxSocketInit(), called from the apps InitInstance fn, rather than WSAStartup. I'm pretty
sure that AfxSocketInit is required for MFC apps (which will eventually call WSAStartup anyway).

I'm currently using Win98 SE, but a quick search through the MSDN library that came with my VC6 brought up a few issues of gethostbyname() returning a list of all local IP addresses under certain conditions if using WinNT - might be worth checking these out?

Hope this helps,


Free
GeneralRe: Resolving Hostname :: MFC Pin
valikac8-Apr-02 4:36
valikac8-Apr-02 4:36 
GeneralWhere to start (new question) Pin
SilverShalkin7-Apr-02 7:40
SilverShalkin7-Apr-02 7:40 
GeneralRe: Where to start (new question) Pin
Paul M Watt7-Apr-02 8:29
mentorPaul M Watt7-Apr-02 8:29 
GeneralRe: Where to start (new question) Pin
SilverShalkin7-Apr-02 8:26
SilverShalkin7-Apr-02 8:26 
GeneralRe: Where to start (new question) Pin
Paul M Watt7-Apr-02 8:59
mentorPaul M Watt7-Apr-02 8:59 
GeneralRe: Where to start (new question) Pin
Christian Graus7-Apr-02 10:09
protectorChristian Graus7-Apr-02 10:09 
GeneralRe: Where to start (new question) Pin
SilverShalkin7-Apr-02 15:25
SilverShalkin7-Apr-02 15:25 
GeneralRe: Where to start (new question) Pin
Christian Graus7-Apr-02 15:26
protectorChristian Graus7-Apr-02 15:26 
GeneralRe: Where to start (new question) Pin
SilverShalkin7-Apr-02 15:49
SilverShalkin7-Apr-02 15:49 
Generalnice book for C++ Pin
7-Apr-02 7:38
suss7-Apr-02 7:38 
GeneralRe: nice book for C++ Pin
alex.barylski7-Apr-02 18:08
alex.barylski7-Apr-02 18:08 
GeneralGrrrrr (quick newbie query) Pin
7-Apr-02 7:35
suss7-Apr-02 7:35 
GeneralRe: Grrrrr (quick newbie query) Pin
PJ Arends7-Apr-02 8:05
professionalPJ Arends7-Apr-02 8:05 
GeneralDisable Resize Window :: MFC Pin
valikac7-Apr-02 7:01
valikac7-Apr-02 7:01 
GeneralRe: Disable Resize Window :: MFC Pin
Paul M Watt7-Apr-02 7:05
mentorPaul M Watt7-Apr-02 7:05 
GeneralRe: Disable Resize Window :: MFC Pin
valikac7-Apr-02 7:10
valikac7-Apr-02 7:10 
GeneralTool tip text Pin
7-Apr-02 6:25
suss7-Apr-02 6: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.