[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

InternetGetConnectedState!!!

Posted on 2000-01-15
1
Medium Priority
?
284 Views
Last Modified: 2013-11-20
Hi All,

I have tried to use the function InternetGetConnectedState like this:

BOOL check = InternetGetConnectedState((unsigned long *)INTERNET_CONNECTION_MODEM, 0) ;

But when I ran my program, an unhandled exception error occured.

I have already included the wininet.h and link the wininet.lib at my projoect.

What is the problem? How can I use this function to check the network connection by modem/LAN.......

Thanks!!!!
0
Comment
Question by:ee_lcpaa
1 Comment
 
LVL 32

Accepted Solution

by:
jhance earned 100 total points
ID: 2355425
How about this instead:

DWORD dwCheck = INTERNET_CONNECTION_MODEM;

BOOL check = InternetGetConnectedState(&dwCheck, 0) ;

Think about what you are saying with:

(unsigned long *)INTERNET_CONNECTION_MODEM

You are using a cast to FORCE a constant into a pointer.  Not the desired result!
0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
There may be issues when you are trying to access Outlook or send & receive emails or due to Outlook crash which leads to corrupt or damaged PST file. To eliminate the corruption from your PST file, you need to repair the corrupt Outlook PST file. U…
Suggested Courses

607 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question