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. newbie thing: Reading command line arguments in an MFC dialog-based App

newbie thing: Reading command line arguments in an MFC dialog-based App

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++algorithmsdata-structures
4 Posts 4 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.
  • A Offline
    A Offline
    andreir23
    wrote on last edited by
    #1

    I realize this sounds idiot, but how do you ?? I can't find any main() or wmain() function in my project and can't acces any argc or argv. I tried to acces them anyway but they are undefined. Searching through the SDK I only found 2 functions: GetCommandLine(); CommandLineToArgvW First one seems to work but the second I couldn't convince to work. And I surely tried. Simply hates me. Does anyone have any ideea, HOW CAN I READ THE COMMAND LINE ARGUMENTS IN AN ARRAY OR SOMETHING SIMILAR TO ARGC AND ARGV? TIA!! ;-)

    R M W 3 Replies Last reply
    0
    • A andreir23

      I realize this sounds idiot, but how do you ?? I can't find any main() or wmain() function in my project and can't acces any argc or argv. I tried to acces them anyway but they are undefined. Searching through the SDK I only found 2 functions: GetCommandLine(); CommandLineToArgvW First one seems to work but the second I couldn't convince to work. And I surely tried. Simply hates me. Does anyone have any ideea, HOW CAN I READ THE COMMAND LINE ARGUMENTS IN AN ARRAY OR SOMETHING SIMILAR TO ARGC AND ARGV? TIA!! ;-)

      R Offline
      R Offline
      Roger Wright
      wrote on last edited by
      #2

      Check here[^]. Heard in Bullhead City - "You haven't lost your girl -
      you've just lost your turn..." [sigh] So true...

      1 Reply Last reply
      0
      • A andreir23

        I realize this sounds idiot, but how do you ?? I can't find any main() or wmain() function in my project and can't acces any argc or argv. I tried to acces them anyway but they are undefined. Searching through the SDK I only found 2 functions: GetCommandLine(); CommandLineToArgvW First one seems to work but the second I couldn't convince to work. And I surely tried. Simply hates me. Does anyone have any ideea, HOW CAN I READ THE COMMAND LINE ARGUMENTS IN AN ARRAY OR SOMETHING SIMILAR TO ARGC AND ARGV? TIA!! ;-)

        M Offline
        M Offline
        Michael Dunn
        wrote on last edited by
        #3

        The CRT sets up equivalent variables for you: __argc and __argv --Mike-- Ericahist | CP SearchBar v2.0.2 | Homepage | 1ClickPicGrabber | RightClick-Encrypt If my rhyme was a drug, I'd sell it by the gram.

        1 Reply Last reply
        0
        • A andreir23

          I realize this sounds idiot, but how do you ?? I can't find any main() or wmain() function in my project and can't acces any argc or argv. I tried to acces them anyway but they are undefined. Searching through the SDK I only found 2 functions: GetCommandLine(); CommandLineToArgvW First one seems to work but the second I couldn't convince to work. And I surely tried. Simply hates me. Does anyone have any ideea, HOW CAN I READ THE COMMAND LINE ARGUMENTS IN AN ARRAY OR SOMETHING SIMILAR TO ARGC AND ARGV? TIA!! ;-)

          W Offline
          W Offline
          wb
          wrote on last edited by
          #4

          search for CCommandLineInfoEx in the MSDN there is some code from Microsoft Systems Journal -- October 1999 Paul DiLascia. the class is realy nice to use.

          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