Click here to Skip to main content
15,925,602 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to trim a wstring. Pin
pallaka22-Jul-08 19:38
pallaka22-Jul-08 19:38 
GeneralRe: How to trim a wstring. Pin
CodingLover22-Jul-08 19:49
CodingLover22-Jul-08 19:49 
Answer[OT] Re: How to trim a wstring. Pin
David Crow23-Jul-08 3:52
David Crow23-Jul-08 3:52 
QuestionRe: [OT] Re: How to trim a wstring. Pin
CodingLover23-Jul-08 19:16
CodingLover23-Jul-08 19:16 
AnswerRe: [OT] Re: How to trim a wstring. Pin
David Crow24-Jul-08 3:35
David Crow24-Jul-08 3:35 
QuestionHow to capture internet explorer events in vc++6 Pin
skumar120922-Jul-08 18:26
skumar120922-Jul-08 18:26 
QuestionMapEditor of Company of Heroes (popup button) Pin
akira3222-Jul-08 12:17
akira3222-Jul-08 12:17 
QuestionTrouble w/ ReadConsoleInput Pin
CoffeeAddict1922-Jul-08 11:16
CoffeeAddict1922-Jul-08 11:16 
The error I'm getting:

1>c:\users\john\documents\visual studio 2008\projects\torch\torch\main.cpp(18) : error C2065: 'lpBuffer' : undeclared identifier

I've seen plenty of examples where ReadConsoleInput is setup to read only 1 INPUT_RECORD and then return, but I'm trying to set it up so that if multiple events occur at once, so they will be placed into a vector array instead. The trouble is that everything stops once ReadConsoleInput starts and I have no easy way of referencing the variable to be stored. Here is my code:

#include "includeall.h"

using namespace std;

int main(int argc, char **argv)
{
    HANDLE hIn = GetStdHandle(STD_INPUT_HANDLE);
    HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);
    DWORD NumRead;
	BOOL eventloop = FALSE;
	vector<INPUT_RECORD>InputRecs;

	printf("Welcome to Bloodhound 1.0a (torch).\n");
	printf("Press the ESC key at any time to exit.\n");

	do
	{
		 X| if(ReadConsoleInput(hIn, InputRecs.push_back(lpBuffer), (DWORD)InputRecs.capacity(), &NumRead) != 0)
		{
			//sort through events
		}
		else //error is present
		{
			printf("Unable to read from console error number (%d)", GetLastError());
			printf(".\n");
			eventloop = FALSE;
		}
		InputRecs.clear();
	}while(eventloop == TRUE);

	

    return 0;
}


Ideas?
AnswerRe: Trouble w/ ReadConsoleInput Pin
David Crow22-Jul-08 13:11
David Crow22-Jul-08 13:11 
QuestionDeleting ODBC Database Pin
Cozmo2322-Jul-08 8:49
Cozmo2322-Jul-08 8:49 
QuestionRe: Deleting ODBC Database Pin
David Crow22-Jul-08 10:29
David Crow22-Jul-08 10:29 
AnswerRe: Deleting ODBC Database Pin
pallaka22-Jul-08 21:02
pallaka22-Jul-08 21:02 
QuestionMFC Application crashes in standard browse dialog box. Pin
Cosmic Egg22-Jul-08 7:20
Cosmic Egg22-Jul-08 7:20 
QuestionRe: MFC Application crashes in standard browse dialog box. Pin
David Crow22-Jul-08 8:38
David Crow22-Jul-08 8:38 
AnswerRe: MFC Application crashes in standard browse dialog box. Pin
Cosmic Egg23-Jul-08 7:28
Cosmic Egg23-Jul-08 7:28 
QuestionRe: MFC Application crashes in standard browse dialog box. Pin
David Crow23-Jul-08 7:36
David Crow23-Jul-08 7:36 
AnswerRe: MFC Application crashes in standard browse dialog box. Pin
Cosmic Egg15-Oct-08 6:04
Cosmic Egg15-Oct-08 6:04 
QuestionDebug assertion error Pin
bhanu_850922-Jul-08 6:29
bhanu_850922-Jul-08 6:29 
QuestionRe: Debug assertion error Pin
David Crow22-Jul-08 7:06
David Crow22-Jul-08 7:06 
AnswerRe: Debug assertion error Pin
Mark Salsbery22-Jul-08 7:21
Mark Salsbery22-Jul-08 7:21 
GeneralRe: Debug assertion error Pin
bhanu_850922-Jul-08 20:12
bhanu_850922-Jul-08 20:12 
AnswerRe: Debug assertion error Pin
Stephen Hewitt22-Jul-08 14:08
Stephen Hewitt22-Jul-08 14:08 
GeneralRe: Debug assertion error Pin
bhanu_850922-Jul-08 20:10
bhanu_850922-Jul-08 20:10 
GeneralRe: Debug assertion error Pin
Stephen Hewitt22-Jul-08 20:13
Stephen Hewitt22-Jul-08 20:13 
GeneralRe: Debug assertion error Pin
bhanu_850922-Jul-08 20:39
bhanu_850922-Jul-08 20:39 

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.