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
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Write text to the command prompt in Dlg based Appln.

Write text to the command prompt in Dlg based Appln.

Scheduled Pinned Locked Moved C / C++ / MFC
questioncsharpc++helpannouncement
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Z Offline
    Z Offline
    zxc89
    wrote on last edited by
    #1

    I am using VC++ .NET(8 Version) to build a Dialog based application, however, my application allows user to input command arguments from the Command prompt window. I want to write some help message when user enters "Some.exe /?" at the command prompt. How can I write text to the command prompt window if user enters the above arguments?(Some.exe /?)

    L 1 Reply Last reply
    0
    • Z zxc89

      I am using VC++ .NET(8 Version) to build a Dialog based application, however, my application allows user to input command arguments from the Command prompt window. I want to write some help message when user enters "Some.exe /?" at the command prompt. How can I write text to the command prompt window if user enters the above arguments?(Some.exe /?)

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      I dont know about .Net, but MFC implements the following: BOOL CSetupApp::InitInstance() { // Standard initialization // If you are not using these features and wish to reduce the size // of your final executable, you should remove from the following // the specific initialization routines you do not need. #ifdef _AFXDLL Enable3dControls(); // Call this when using MFC in a shared DLL #else Enable3dControlsStatic(); // Call this when linking to MFC statically #endif CSetupDlg dlg; m_pMainWnd = &dlg; if(stricmp(m_lpCmdLine, "-f") == 0) dlg.ForceInstall = TRUE; else dlg.ForceInstall = FALSE; int nResponse = dlg.DoModal(); if (nResponse == IDOK) { // TODO: Place code here to handle when the dialog is // dismissed with OK } else if (nResponse == IDCANCEL) { // TODO: Place code here to handle when the dialog is // dismissed with Cancel } // Since the dialog has been closed, return FALSE so that we exit the // application, rather than start the application's message pump. return FALSE; } for dialog based apps. ie, there is an inbuilt command line to the app, that you can handle, and choose to create the dialog or, in your case, just print to standard out. Perhaps .Net has a similar mechanism.

      Truth is the subjection of reality to an individuals perception

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

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