After prompts and help from QQ group and Forum users, the executable version was finally modified.
Long _ fastcall tfrmmain: winexecandwait (ansistring acmdline, int visibility) <br/>{</P> <p> char zappname [512]; </P> <p> process_information processinfo = {0}; </P> <p> startupinfo = {sizeof (startupinfo)}; // initialization, set the first value to 0 or null </P> <p> memset (zappname, 0, sizeof (zappname )); <br/> strcpy (zappname, acmdline. c_str (); </P> <p> startupinfo. dwflags = startf_useshowwindow; <br/> startupinfo. wsho Wwindow = visibility; <br/> // startupinfo. wshowwindow: = sw_normal; <br/> // startupinfo-> wshowwindow = sw_hide; </P> <p> If (! CreateProcess (null, zappname, null, null, false, 0, null, null, & startupinfo, & processinfo) <br/>{< br/> return-1; <br/>}< br/> else <br/> {<br/> unsigned long result = 0; <br/> waitforsingleobject (processinfo. hprocess, infinite); <br/> getexitcodeprocess (processinfo. hprocess, & result); <br/> return result; <br/>}</P> <p>
PS: In the QQ Group, a netizen "Migrant Worker Yi" gave me the greatest help. His familiarity with C ++ MFC and debugging methods made me feel deeply, unfortunately, he now only has a high school diploma, and many resumes have been submitted, and he has no interview opportunities.