Click here to Skip to main content
16,005,181 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: vector: Container problem Pin
Marvin M.27-Sep-05 15:26
Marvin M.27-Sep-05 15:26 
AnswerRe: vector: Container problem Pin
shade44427-Sep-05 15:36
shade44427-Sep-05 15:36 
Questioncode for view video in c++ Pin
Lioz Cohn27-Sep-05 9:03
Lioz Cohn27-Sep-05 9:03 
AnswerRe: code for view video in c++ Pin
Christian Graus27-Sep-05 9:22
protectorChristian Graus27-Sep-05 9:22 
Questionsource code for view video in c++ Pin
Lioz Cohn27-Sep-05 9:01
Lioz Cohn27-Sep-05 9:01 
QuestionLaunching GUI or Console Pin
Prabhu97727-Sep-05 8:02
Prabhu97727-Sep-05 8:02 
AnswerRe: Launching GUI or Console Pin
David Crow27-Sep-05 8:10
David Crow27-Sep-05 8:10 
GeneralRe: Launching GUI or Console Pin
Prabhu97728-Sep-05 7:40
Prabhu97728-Sep-05 7:40 
I tried two options today and I think I found the solution.

First of all what I wanted was:

Depending on the parameters from the command line, I wanted to launch a console window or a GUI. So I wanted console/GUI support from the one and the same MFC application.

So what I did was to use CCommandLineInfo derived class to determine the parameters. So if I found /mode: command in then:

1. I used (as suggested by one of you) used the console functions to determine the standard input handle and do a ReadConsole from it to get the character typed.
i.e.,
AllocConsole();//to show the console
HANDLE hIn = GetStdHandle();
ReadFile(hIn,...)

But I had one problem with this. If this application is launched from cmd.exe, then two console windows were visible: One from where I call Start test.exe, one created in the test.exe using AllocConsole.

2. I found another solution. I used the #pragma directive:
#pragma comment(linker, "/subsystem:console")

This brought a console window as expected. When launched from cmd.exe this did not launch a new console.

I think the second solution more cleaner and simple.

Thanks for the help from all of you. If you have any suggestions regardig the above, please let me know.

Bye and c ya!
GeneralRe: Launching GUI or Console Pin
Prabhu97728-Sep-05 7:40
Prabhu97728-Sep-05 7:40 
AnswerRe: Launching GUI or Console Pin
oustar27-Sep-05 21:28
oustar27-Sep-05 21:28 
AnswerRe: Launching GUI or Console Pin
AHawk27-Sep-05 22:21
AHawk27-Sep-05 22:21 
QuestionOnNcPaint() to draw Borders Pin
Lea Hayes27-Sep-05 7:12
Lea Hayes27-Sep-05 7:12 
AnswerRe: OnNcPaint() to draw Borders Pin
Shog927-Sep-05 7:45
sitebuilderShog927-Sep-05 7:45 
GeneralRe: OnNcPaint() to draw Borders Pin
Lea Hayes27-Sep-05 9:11
Lea Hayes27-Sep-05 9:11 
QuestionIPControl Adress " CIPAddressCtrl " Pin
REU27-Sep-05 6:58
REU27-Sep-05 6:58 
AnswerRe: IPControl Adress " CIPAddressCtrl " Pin
David Crow27-Sep-05 8:14
David Crow27-Sep-05 8:14 
QuestionCOM question Pin
includeh1027-Sep-05 6:53
includeh1027-Sep-05 6:53 
AnswerRe: COM question Pin
Calc2027-Sep-05 20:15
Calc2027-Sep-05 20:15 
Questioncreate a download software Pin
includeh1027-Sep-05 6:45
includeh1027-Sep-05 6:45 
Questionactive-x control Pin
tejaswi-teja27-Sep-05 5:51
tejaswi-teja27-Sep-05 5:51 
QuestionHow to get the HTTP visit? Pin
rushing27-Sep-05 5:14
rushing27-Sep-05 5:14 
AnswerRe: How to get the HTTP visit? Pin
mikanu27-Sep-05 5:31
mikanu27-Sep-05 5:31 
QuestionUsing a VC7.1 dll in VC6? Pin
John M. Drescher27-Sep-05 4:17
John M. Drescher27-Sep-05 4:17 
AnswerRe: Using a VC7.1 dll in VC6? Pin
John M. Drescher28-Sep-05 4:20
John M. Drescher28-Sep-05 4:20 
QuestionDLL project not producing the .LIB file Pin
mukhopadhyay somenath27-Sep-05 3:42
professionalmukhopadhyay somenath27-Sep-05 3:42 

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.