CFanatic

Go Back   CFanatic > Programming > MFC Programming

how to check internet connection topic posted under MFC Programming which is a part of Programming category in CFanatic Forum
Reply
 
Thread Tools Display Modes
  #1  
Old 09-14-2006, 09:54 PM
Junior Member
 
Join Date: Sep 2006
Posts: 1
Thanks: 0
Thanked 2 Times in 1 Post
Hystrio is on a distinguished road
| More
how to check internet connection

Hi all!

I am not a very smart programmer (just for hobby) so bear with me!

I have written a small program with MFC to log my internet connections (date and times which are written into a file). Tha fact is that I have to open and close it manually, after I open and close the connection. What I would like to do is this:

after I lauch the program, it should monitor possible connections, so that as soon as I connect with Internet it checks the time and when I close the connection it stops it.

Are there functions to do this?

Thank you all in advance

Orlando
Reply With Quote
The Following 2 Users Say Thank You to Hystrio For This Useful Post:
Amit kumar jecrc (02-16-2011), shabbir (05-06-2013)
  #2  
Old 07-24-2008, 11:58 PM
Junior Member
 
Join Date: Jul 2008
Posts: 3
Thanks: 0
Thanked 1 Time in 1 Post
e_pech is on a distinguished road
| More
Smile Re: how to check internet connection

#include <Wininet.h>
#pragma comment(lib,"wininet.lib")

if (InternetGetConnectedState(INTERNET_CONNECTION_LAN | INTERNET_CONNECTION_MODEM,0) == FALSE)
{
// Don't attempt connection or it will bring up the dialog
}


I've tried it before, it works fine!

http://www.experts-exchange.com/Prog..._23262600.html

on that link, you'll have to scroll all the way down to see the answer!
Reply With Quote
The Following User Says Thank You to e_pech For This Useful Post:
Amit kumar jecrc (02-16-2011)
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
MFC SDI with ODBC Connection gaurav0381 MFC Programming 8 02-26-2008 05:45 AM
tristate check box sunil MFC Programming 1 02-26-2008 02:29 AM
connection to server in mfc suresh vaikuntam Introduce yourself 0 09-12-2007 09:08 AM



Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO ©2010, Crawlability, Inc.