Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
P

Prabhu977

@Prabhu977
About
Posts
4
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Launching GUI or Console
    P Prabhu977

    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 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!

    C / C++ / MFC c++ help question

  • Launching GUI or Console
    P Prabhu977

    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!

    C / C++ / MFC c++ help question

  • Using typedef with an array
    P Prabhu977

    use: typedef float Sequence; Sequence a[10]; Bye and c ya!

    Managed C++/CLI help data-structures tutorial question

  • Launching GUI or Console
    P Prabhu977

    Hi, I have a Single Document MFC application. I have a requirement to give command line support to this application. This means based on the command line arguments provided to the existing MFC application, it should either come up in GUI mode or in console mode. For e.g: 1. Launching the application like: "Test.exe /mode: GUI" from command prompt should launch the existing GUI application. 2. Launching the application like: "Test.exe /mode: CLI" should launch a console window. I should be able to output data to this window say using "cout" and input data from the console window using "cin". Is this possible? Can someone please help me? Thanks in advance! Bye!

    C / C++ / MFC c++ help question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups