flex - How to get command line arguments for a running process -
in program, have been receiving error when use command-line compile command mxmlc. error related embedded font name not being correctly identified flex in system fonts list.
however, on whim, decided copy code flex builder , compile there. surprise, worked, , found proper font using same system name had given (pmingliu).
i suspected problem may locale one, , system cannot correctly identify font name because of locale considerations.
i've tried setting locale of compile code en_us, no avail. ask if here knows how flex builder invokes mxml compiler , differences there compared running mxmlc directly? know it's not using mxmlc.exe directly, since tried replacing mxmlc our own executable capture command line parameters.
if matters, os used windows xp.
although don't have exact answer question (what command line arguments flex builder passes mxmlc.exe), have meta-answer you. can find command line using 1 of 2 methods.
the first platform-agnostic require compile small c++ program. i've used approach before when solving similar problems. can create wrapper application outputs command line file. build application , drop in temporary replacement mxmlc.exe, , when flex builder executes you'll able access resulting file "cmdline.txt" full command line called with:
#include <iostream> #include <fstream> using namespace std; int main(int argc, char* argv[]) { ofstream cmdline; cmdline.open("cmdline.txt"); (int = 0; < argc; i++) { cmdline << argv[i]; if (i < argc) cmdline << " "; } cmdline.close(); return 0; }
if don't feel right playing dirty trick on flex builder, there alternative assuming you're running on windows. can use wmi iterate on of running processes , grab command line information. ruby being language of choice, require install ruby interpreter windows can one-click ruby installer windows.
after installing, run script flex builder kicks off build:
require 'win32ole' wmi = win32ole.connect("winmgmts://") processes = wmi.execquery("select * win32_process") process in processes cmdline = process.commandline puts "command line: #{cmdline}" if cmdline =~ /mxmlc/ end
i've added in regular expression print out command line processes started "mxmlc" in command line (which should work needs). more general solution of iterating on each process, remove if clause @ end of line containing:
puts "command line: #{cmdline}" if cmdline =~ /mxmlc/
this save headache of doing low-level magic startremotethread , navigating through peb structures.
that's best considering nature of question , without more information regarding development os. if solves problem might suggest edit post people facing similar issues can find solution. title "how command line arguments running process" might more apt.
Comments
Post a Comment