Incomplete argv/argc when using FTYPE and ASSOC on XP

Discussion in 'MFC' started by robena, Jan 28, 2008.

  1. robena

    robena New Member

    Jan 28, 2008
    Likes Received:
    Trophy Points:
    I'm trying to use a standard C main() program with FTYPE and ASSOC.

    The main.c program is:

    int main( int argc, char **argv) 
      int i; 
      printf("argc = %d\n", argc); 
      for(i=0; i<argc; i++) 
      printf ("argv[%d] = %s\n", i, argv[i]); 

    And I use in a DOS windows:

    ASSOC .ma=MainScript 
    FTYPE MainScript=main.exe %1 %* 

    If I call the program in this way:

    Code: 1 2 3 
    I only get:

    argc = 2 
    argv[0] = main.exe 
    argv[1] = 

    The command line arguments ("1", "2" and "3") here are not visible in argc/argv.

    How do I retrieve these arguments in the C program?

    Using exactly the same ASSOC and FTYPE syntax works with other programs, so there is something that I am missing.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice