Click here to Skip to main content
15,897,371 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: To Click on an button programmatically Pin
mikobi1-Feb-07 4:29
mikobi1-Feb-07 4:29 
GeneralRe: To Click on an button programmatically Pin
Hamid_RT1-Feb-07 20:54
Hamid_RT1-Feb-07 20:54 
QuestionRe: To Click on an button programmatically Pin
David Crow1-Feb-07 4:01
David Crow1-Feb-07 4:01 
Questiongetch() problem Pin
sachin ahuja1-Feb-07 3:03
sachin ahuja1-Feb-07 3:03 
AnswerRe: getch() problem Pin
jhwurmbach1-Feb-07 3:05
jhwurmbach1-Feb-07 3:05 
GeneralRe: getch() problem Pin
sachin ahuja1-Feb-07 4:12
sachin ahuja1-Feb-07 4:12 
GeneralRe: getch() problem Pin
toxcct1-Feb-07 4:14
toxcct1-Feb-07 4:14 
GeneralRe: getch() problem [modified] Pin
jhwurmbach1-Feb-07 5:23
jhwurmbach1-Feb-07 5:23 
sachin ahuja wrote:
A lot of code


Ok, where is the exception coming up?
Certainly not in the piece of code you showed. Most of it is commented out and the other part is not compiling because Initialize() is missing.

So, please use the debugger to find out which line is crashing and prepare a running, minimal program demonstrating the error.
And, as toxcct said, put your code in the pre - tags by marking it and then clicking on "pre". On your screen just above the line with the smilies.

I turned your code into a working mini-application:
#include <windows.h>
#include <conio.h>
#include <string>

int main(int argc, char* argv[])
{

	//char szGetString[500];
	std::string sData;
	int Error;
	int i = 0, j = 0;
	COORD origin={0,0};
	char sIniPath[100];
	//DWORD NoOfCharRead;
	const int ERR_HT_HANDLE = -1;
	CONSOLE_SCREEN_BUFFER_INFO ConsoleScreenBufferInfo;

	int ch = ::getche();

	//Initializing the application
	//if(SUCCESS != (Error = Initialize()))
	//	printf("Error in initilaizing the application\n");

	HANDLE hStdOut = ::GetStdHandle( STD_OUTPUT_HANDLE);
	if(INVALID_HANDLE_VALUE == hStdOut)	{
		Error = ERR_HT_HANDLE;
	}
	GetConsoleScreenBufferInfo(hStdOut , &ConsoleScreenBufferInfo);

	//Setting color for stdout
	ConsoleScreenBufferInfo.wAttributes = FOREGROUND_GREEN;

	SetConsoleTextAttribute(hStdOut ,ConsoleScreenBufferInfo.wAttributes);

	//Setting color for stderr
	HANDLE hStdErr = GetStdHandle( STD_ERROR_HANDLE);
	if(INVALID_HANDLE_VALUE == hStdErr)	{
		Error = ERR_HT_HANDLE;
	}
	GetConsoleScreenBufferInfo(hStdErr , &ConsoleScreenBufferInfo);
	ConsoleScreenBufferInfo.wAttributes = FOREGROUND_RED;
	SetConsoleTextAttribute(hStdErr ,ConsoleScreenBufferInfo.wAttributes);

	//Getting handle for input buffer
	HANDLE hStdIn = GetStdHandle(STD_INPUT_HANDLE);
	if(INVALID_HANDLE_VALUE == hStdIn)	{
		Error = ERR_HT_HANDLE;
	}

}



-- modified at 4:01 Friday 2nd February, 2007
!"§$%& includes missing


"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."

-- Caius Petronius, Roman Consul, 66 A.D.

GeneralRe: getch() problem Pin
sachin ahuja1-Feb-07 17:34
sachin ahuja1-Feb-07 17:34 
GeneralRe: getch() problem Pin
jhwurmbach1-Feb-07 21:50
jhwurmbach1-Feb-07 21:50 
GeneralRe: getch() problem Pin
sachin ahuja5-Feb-07 1:29
sachin ahuja5-Feb-07 1:29 
GeneralGood! Pin
jhwurmbach5-Feb-07 4:54
jhwurmbach5-Feb-07 4:54 
Questionuse Unicode DLL to non unicode application Pin
Atul231-Feb-07 2:29
Atul231-Feb-07 2:29 
AnswerRe: use Unicode DLL to non unicode application Pin
Hamid_RT1-Feb-07 20:55
Hamid_RT1-Feb-07 20:55 
Questionopen program while boot windows Pin
Max++1-Feb-07 2:22
Max++1-Feb-07 2:22 
AnswerRe: open program while boot windows Pin
Maximilien1-Feb-07 2:58
Maximilien1-Feb-07 2:58 
AnswerRe: open program while boot windows Pin
David Crow1-Feb-07 2:58
David Crow1-Feb-07 2:58 
GeneralRe: open program while boot windows Pin
Max++1-Feb-07 3:05
Max++1-Feb-07 3:05 
GeneralRe: open program while boot windows Pin
David Crow1-Feb-07 3:21
David Crow1-Feb-07 3:21 
GeneralRe: open program while boot windows Pin
Max++1-Feb-07 6:18
Max++1-Feb-07 6:18 
JokeRe: open program while boot windows Pin
toxcct1-Feb-07 6:34
toxcct1-Feb-07 6:34 
GeneralRe: open program while boot windows Pin
Mark Salsbery1-Feb-07 7:53
Mark Salsbery1-Feb-07 7:53 
GeneralRe: open program while boot windows Pin
toxcct1-Feb-07 21:42
toxcct1-Feb-07 21:42 
GeneralRe: open program while boot windows Pin
Hamid_RT2-Feb-07 4:23
Hamid_RT2-Feb-07 4:23 
GeneralRe: open program while boot windows Pin
Mark Salsbery2-Feb-07 5:29
Mark Salsbery2-Feb-07 5:29 

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.