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

C / C++ / MFC

 
AnswerRe: How to count number of files in a folder Pin
kcynic13-Dec-07 18:28
kcynic13-Dec-07 18:28 
GeneralRe: How to count number of files in a folder Pin
santhoshv8413-Dec-07 18:46
santhoshv8413-Dec-07 18:46 
GeneralRe: How to count number of files in a folder Pin
Hamid_RT14-Dec-07 20:04
Hamid_RT14-Dec-07 20:04 
GeneralSeraching criteria Pin
neha.agarwal2713-Dec-07 17:55
neha.agarwal2713-Dec-07 17:55 
GeneralRe: Seraching criteria Pin
Karismatic13-Dec-07 19:09
Karismatic13-Dec-07 19:09 
GeneralRe: Seraching criteria Pin
vijay_aroli13-Dec-07 19:17
vijay_aroli13-Dec-07 19:17 
GeneralConsole application and MFC-DLL application Pin
CodingLover13-Dec-07 17:15
CodingLover13-Dec-07 17:15 
GeneralDetecting internet connection using InternetGetConnectedState in VC++ Pin
Kogee San13-Dec-07 16:58
Kogee San13-Dec-07 16:58 
Hello again everyone

Before that i would like to tell u all that im really new and dumb to .NET. Hope you guys can help me. I tried to search the solution to my problem but still couldnt find anything.

What im trying to do is to create a really simple internet connection detection which is running under a win32 console. The program will detect if there is any connection to the internet, if yes then it will print yes. If no connection then it will print out no connection using printf() statement.

I know that the InternetGetConnectedState API can help me. but still im not so sure on how to use it. Really dumb me...the scenario is like this

I already link the VC++ project to the Wininet.lib since it required that lib and a header file called Wininet.h (as refered in MSDN). I try to code just by adding the header file to the source code

<br />
#include "stdio.h"<br />
#include "Wininet.h"<br />
void main()<br />
{<br />
}<br />


using the code above, compile, it generates more than 100 error which particularly made the compiler to stop compiling due to error exceeds 100. all of the errors come from the Wininet.h header file. The first error was "error C2061: syntax error:Identifier 'HINTERNET'. The question is, am i missing something. Does VC++ supports this API? I've search the internet (forums..etc) and all of them were implemented using C# or VB. Is there any source code samples using this API which can be run only in a simple win32 console application? Thank you everyone. Really appreciate any help. Thanks again.
GeneralRe: Detecting internet connection using InternetGetConnectedState in VC++[Modified] Pin
Naveen13-Dec-07 17:11
Naveen13-Dec-07 17:11 
GeneralRe: Detecting internet connection using InternetGetConnectedState in VC++[Modified] Pin
Kogee San13-Dec-07 17:19
Kogee San13-Dec-07 17:19 
GeneralRe: Detecting internet connection using InternetGetConnectedState in VC++[Modified] Pin
Naveen13-Dec-07 18:34
Naveen13-Dec-07 18:34 
GeneralRe: Detecting internet connection using InternetGetConnectedState in VC++[Modified] Pin
David Crow14-Dec-07 3:40
David Crow14-Dec-07 3:40 
GeneralRe: Detecting internet connection using InternetGetConnectedState in VC++[Modified] Pin
Kogee San16-Dec-07 14:28
Kogee San16-Dec-07 14:28 
GeneralTemplate Pin
james_dixon_200813-Dec-07 15:23
james_dixon_200813-Dec-07 15:23 
GeneralRe: Template Pin
Mark Salsbery13-Dec-07 16:26
Mark Salsbery13-Dec-07 16:26 
GeneralRe: Template Pin
james_dixon_200813-Dec-07 17:19
james_dixon_200813-Dec-07 17:19 
GeneralRe: Template Pin
Mark Salsbery13-Dec-07 18:50
Mark Salsbery13-Dec-07 18:50 
GeneralRe: Template Pin
Nibu babu thomas13-Dec-07 16:32
Nibu babu thomas13-Dec-07 16:32 
GeneralCheck for input from console in C++ Pin
dabs13-Dec-07 14:45
dabs13-Dec-07 14:45 
GeneralRe: Check for input from console in C++ Pin
Naveen13-Dec-07 16:12
Naveen13-Dec-07 16:12 
GeneralRe: Check for input from console in C++ Pin
dabs14-Dec-07 3:28
dabs14-Dec-07 3:28 
GeneralCString into string Pin
CodingLover13-Dec-07 14:27
CodingLover13-Dec-07 14:27 
GeneralRe: CString into string Pin
Mark Salsbery13-Dec-07 15:16
Mark Salsbery13-Dec-07 15:16 
GeneralRe: CString into string Pin
CodingLover13-Dec-07 15:34
CodingLover13-Dec-07 15:34 
GeneralRe: CString into string [modified] Pin
Mark Salsbery13-Dec-07 16:19
Mark Salsbery13-Dec-07 16:19 

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.