Ok
Ive made a minimal example to show whats happening:
I left everything in the repo
The program test.c just takes the first file passed on the command line and copies it to the next file on the command line.
The batch file build.bat will compile the test program using VC command line (just to prove the program compiles and works ok. If you dont have Visual Studio installed, this bit wont work, but its not necessary. It then builds 2 versions of test.c using emcc. One html version and one javascript version. The HTML version runs the compiled c program and if I modify the HTML to include the command line parameters, they get passed into the exe
Ive included a file emstest_mod.html where I have done this. noInitialRun is set to true in the file and indeed it doesnt run initially. In this version I get the error run is undefined though
If you take a look at the file test.html you will see what I am trying to do. Ive copied over the Module code from the HTML file and modified it a little. In this version, preRun is not called, arguments are ignored as is noInitialRun:true. The program just runs. If you comment out the last line in build.bat, it compiles with the flag INVOKE_RUN=0.
In this build, running test.html, preRun is called, but the compiled C program is never called!
So I can get the C program to run with no parameters (the Module definition is ignored) and only on page load, not triggered or I can get the module definition to be recognised (as preRun gets called) but the compiled C program wont run
Hope all this makes sense! I must be doing something wrong as I guess this is a standard use case. I have a load of C code I want to call repeatedly to convert some files as part of of bigger web app.
Bryan