Click here to Skip to main content
15,916,683 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Implementing HTTP Client Pin
Ravi Bhavnani7-Apr-04 1:22
professionalRavi Bhavnani7-Apr-04 1:22 
GeneralRe: Implementing HTTP Client Pin
2249177-Apr-04 1:23
2249177-Apr-04 1:23 
GeneralAnother problem scrolling large document Pin
Still learning how to code6-Apr-04 22:22
Still learning how to code6-Apr-04 22:22 
GeneralRe: Another problem scrolling large document Pin
Roger Allen6-Apr-04 22:52
Roger Allen6-Apr-04 22:52 
GeneralProblem with setting timeout in C++ Pin
ArFuk6-Apr-04 22:07
ArFuk6-Apr-04 22:07 
GeneralRe: Problem with setting timeout in C++ Pin
Rage6-Apr-04 22:21
professionalRage6-Apr-04 22:21 
GeneralRe: Problem with setting timeout in C++ Pin
ArFuk6-Apr-04 22:45
ArFuk6-Apr-04 22:45 
GeneralRe: Problem with setting timeout in C++ Pin
Maxwell Chen6-Apr-04 23:38
Maxwell Chen6-Apr-04 23:38 
You want something like this?
#include <iostream>
#include <conio.h>
#include <ctime>
using namespace std;

time_t	g_Time = 0;
unsigned int g_uInterval;

void SetTimeout(unsigned int uX)
{
	g_uInterval = uX;
}

void Begin()
{
	g_Time = time(0);
}

bool IsTimeout()
{
	if( g_uInterval < difftime(time(0), g_Time) )
		return true;
	return false;
}

void main()
{
	unsigned int uX = 20;
	cout << "Press any key in " << uX << " sec.\n";
	SetTimeout(20);
	Begin();
	while(1)
	{
		if(_kbhit()) {
			cout << "Key pressed.\n";
			break;
		}
		if(IsTimeout()) {
			cout << "Time out.\n";
			return;
		}
	}
	getch();
}


Maxwell Chen
GeneralProblem with windows and frames. Pin
Victor Nikol6-Apr-04 21:58
Victor Nikol6-Apr-04 21:58 
GeneralPossible errors when using CDialog::Create(); Pin
anderslundsgard6-Apr-04 21:05
anderslundsgard6-Apr-04 21:05 
QuestionHow much voltage is required to operate a seven segment LED Pin
Member 9936936-Apr-04 20:38
Member 9936936-Apr-04 20:38 
AnswerRe: How much voltage is required to operate a seven segment LED Pin
Rory Solley6-Apr-04 22:02
Rory Solley6-Apr-04 22:02 
AnswerRe: How much voltage is required to operate a seven segment LED Pin
Prakash Nadar6-Apr-04 22:26
Prakash Nadar6-Apr-04 22:26 
Generaljpeg convert to bmp Pin
daoyu20006-Apr-04 18:47
daoyu20006-Apr-04 18:47 
GeneralRe: jpeg convert to bmp Pin
Antony M Kancidrowski7-Apr-04 2:21
Antony M Kancidrowski7-Apr-04 2:21 
GeneralRe: jpeg convert to bmp Pin
daoyu20007-Apr-04 23:48
daoyu20007-Apr-04 23:48 
GeneralRe: jpeg convert to bmp Pin
Antony M Kancidrowski8-Apr-04 2:25
Antony M Kancidrowski8-Apr-04 2:25 
GeneralRe: jpeg convert to bmp Pin
daoyu20008-Apr-04 4:25
daoyu20008-Apr-04 4:25 
GeneralApplication change to Service can not receive message Pin
tank10256-Apr-04 18:00
tank10256-Apr-04 18:00 
GeneralRe: Application change to Service can not receive message Pin
2249176-Apr-04 19:11
2249176-Apr-04 19:11 
GeneralRe: Application change to Service can not receive message Pin
tank10256-Apr-04 19:45
tank10256-Apr-04 19:45 
GeneralRe: Application change to Service can not receive message Pin
tank10257-Apr-04 5:25
tank10257-Apr-04 5:25 
Questionhow to convert??? Pin
don7cry6-Apr-04 17:37
don7cry6-Apr-04 17:37 
AnswerRe: how to convert??? Pin
Christian Graus6-Apr-04 18:31
protectorChristian Graus6-Apr-04 18:31 
GeneralRe: how to convert??? Pin
Maxwell Chen6-Apr-04 18:44
Maxwell Chen6-Apr-04 18:44 

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.