Click here to Skip to main content
15,887,596 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Other Language(Japanese) string values in QuickWatch while debugging Pin
Akt_4_U18-Sep-06 23:37
Akt_4_U18-Sep-06 23:37 
GeneralRe: Other Language(Japanese) string values in QuickWatch while debugging Pin
bharath_k19-Sep-06 0:13
bharath_k19-Sep-06 0:13 
QuestionHandling events in MFC. Pin
Pratheep Kenny18-Sep-06 21:16
Pratheep Kenny18-Sep-06 21:16 
AnswerRe: Handling events in MFC. Pin
Christian Graus18-Sep-06 21:41
protectorChristian Graus18-Sep-06 21:41 
AnswerRe: Handling events in MFC. Pin
Hamid_RT18-Sep-06 21:51
Hamid_RT18-Sep-06 21:51 
AnswerRe: Handling events in MFC. Pin
Pratheep Kenny19-Sep-06 0:45
Pratheep Kenny19-Sep-06 0:45 
QuestionHow to get the a system's Uniquee ip address on internet through coding ! Pin
gloriousgopi18-Sep-06 21:04
gloriousgopi18-Sep-06 21:04 
AnswerRe: How to get the a system's Uniquee ip address on internet through coding ! Pin
Matt Godbolt18-Sep-06 22:49
Matt Godbolt18-Sep-06 22:49 
I can't speak for MFC itself, but the way I've done this before is:

  • Create a new UDP socket.
  • Call 'connect' with a non-local IP (I've used google.com's IP but any will do)
  • Call 'getsockname' on the socket to get the local address.
  • Close the socket


Note that no data is ever sent on the network - this approach uses the fact that connect()ing a UDP socket doesn't do anything but bind the socket addresss. A side effect of this is that the local address (as returned by getsockname) is set to the outbound IP address of the machine. Or rather, the IP address that is used to tgalk to the non-local IP you specified.

Unfortunately, if you're behind a NAT (as most people are these days) getting the real external IP is somewhat different. I believe you can use UPNP (if your router supports it) but the only way I'm aware of is to actually connect to and exchange data with an external server who can then tell you which IP address you're coming from. This relies on you having a server running somewhere...which is a bit beyond your original question.

I hope that's at least of some help!

Matt Godbolt
StyleManager - a C/C++ source code reformatter
IncludeManager - #include graph viewer

GeneralRe: How to get the a system's Uniquee ip address on internet through coding ! Pin
gloriousgopi18-Sep-06 23:18
gloriousgopi18-Sep-06 23:18 
AnswerRe: How to get the a system's Uniquee ip address on internet through coding ! Pin
David Crow19-Sep-06 3:46
David Crow19-Sep-06 3:46 
AnswerRe: How to get the a system's Uniquee ip address on internet through coding ! Pin
cmk19-Sep-06 8:19
cmk19-Sep-06 8:19 
QuestionRegarding " #if _MSC_VER >= 1100" Pin
janadhana18-Sep-06 20:29
janadhana18-Sep-06 20:29 
AnswerRe: Regarding " #if _MSC_VER >= 1100" Pin
Christian Graus18-Sep-06 20:40
protectorChristian Graus18-Sep-06 20:40 
AnswerRe: Regarding " #if _MSC_VER >= 1100" Pin
prasad_som18-Sep-06 20:41
prasad_som18-Sep-06 20:41 
AnswerRe: Regarding " #if _MSC_VER >= 1100" Pin
Nibu babu thomas18-Sep-06 20:42
Nibu babu thomas18-Sep-06 20:42 
QuestionListing files in a directory Pin
Imtiaz Murtaza18-Sep-06 20:11
Imtiaz Murtaza18-Sep-06 20:11 
AnswerRe: Listing files in a directory Pin
Nibu babu thomas18-Sep-06 20:40
Nibu babu thomas18-Sep-06 20:40 
AnswerRe: Listing files in a directory Pin
Hamid_RT18-Sep-06 21:02
Hamid_RT18-Sep-06 21:02 
AnswerRe: Listing files in a directory Pin
David Crow19-Sep-06 3:54
David Crow19-Sep-06 3:54 
QuestionHow to paint the caption bar Pin
kiranin18-Sep-06 18:50
kiranin18-Sep-06 18:50 
AnswerRe: How to paint the caption bar Pin
prasad_som18-Sep-06 19:29
prasad_som18-Sep-06 19:29 
AnswerRe: How to paint the caption bar Pin
Hamid_RT18-Sep-06 19:31
Hamid_RT18-Sep-06 19:31 
GeneralRe: How to paint the caption bar Pin
kiranin18-Sep-06 19:35
kiranin18-Sep-06 19:35 
GeneralRe: How to paint the caption bar Pin
Hamid_RT18-Sep-06 20:48
Hamid_RT18-Sep-06 20:48 
GeneralRe: How to paint the caption bar Pin
kiranin18-Sep-06 21:36
kiranin18-Sep-06 21:36 

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.