Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Although I don't have the exact answer to your question (what command line arguments Flex Builder passes to mxmlc.exe), I do have a meta-answer for you. You can find the command line by using one of two methods.</p> <p>The first is platform-agnostic but will require you to compile a small C++ program. I've used this approach before when solving similar problems. What you can do is create a wrapper application which simply outputs the command line to a file. Build this application and drop it in as a temporary replacement for your mxmlc.exe, and when Flex Builder executes it you'll be able to access the resulting file "cmdline.txt" to get the full command line that it was called with:</p> <pre><code>#include &lt;iostream&gt; #include &lt;fstream&gt; using namespace std; int main(int argc, char* argv[]) { ofstream cmdLine; cmdLine.open("cmdline.txt"); for (int i = 0; i &lt; argc; i++) { cmdLine &lt;&lt; argv[i]; if (i &lt; argc) cmdLine &lt;&lt; " "; } cmdLine.close(); return 0; } </code></pre> <p>If you don't feel right about playing this dirty trick on Flex Builder, there is an alternative assuming you're running on Windows. You can use <a href="http://en.wikipedia.org/wiki/Windows_Management_Instrumentation" rel="nofollow noreferrer">WMI</a> to iterate over all of the running processes and grab their command line information. Ruby being my language of choice, this would require you to install the Ruby interpreter for Windows which you can do easily with the <a href="http://rubyinstaller.rubyforge.org/" rel="nofollow noreferrer">One-Click Ruby Installer for Windows</a>.</p> <p>After installing, just run this script as soon as Flex Builder kicks off your build:</p> <pre><code>require 'win32ole' wmi = WIN32OLE.connect("winmgmts://") processes = wmi.ExecQuery("select * from win32_process") for process in processes do cmdLine = process.CommandLine puts "Command line: #{cmdLine}" if cmdLine =~ /mxmlc/ end </code></pre> <p>I've added in a regular expression to print out the command line only for processes which were started with "mxmlc" in the command line (which should work for your needs). For a more general solution of iterating over each process, just remove the if clause at the end of the line containing:</p> <pre><code>puts "Command line: #{cmdLine}" if cmdLine =~ /mxmlc/ </code></pre> <p>This will save you the headache of doing any low-level magic with StartRemoteThread and navigating through the PEB structures.</p> <p>That's about the best I could do considering the nature of your question and without more information regarding your development OS. If this solves your problem I might suggest that you edit your post so that people facing similar issues can find this solution. A title like "How to get command line arguments for a running process" might be more apt.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload