Go4Expert

Go4Expert (http://www.go4expert.com/)
-   MFC (http://www.go4expert.com/forums/mfc/)
-   -   Incomplete argv/argc when using FTYPE and ASSOC on XP (http://www.go4expert.com/forums/incomplete-argv-argc-using-ftype-assoc-t8520/)

robena 28Jan2008 20:35

Incomplete argv/argc when using FTYPE and ASSOC on XP
 
I'm trying to use a standard C main() program with FTYPE and ASSOC.

The main.c program is:

Code:

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:

Code:

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


If I call the program in this way:

Code:

testma.ma 1 2 3
I only get:

Code:

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


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.


All times are GMT +5.5. The time now is 08:08.