Author Topic: Starting a New Process (IDE invokes compiler)  (Read 1517 times)

0 Members and 1 Guest are viewing this topic.

Charles Pegge

  • Admin Support Member
  • *****
  • Posts: 3721
    • Oxygen Basic
Starting a New Process (IDE invokes compiler)
« on: July 06, 2012, 01:40:30 AM »

The IDE saves the source code to a temp file and invokes the compiler, with the file name in the commandl-ine.

In this example, there is no further interaction between IDE and compiler.

Code: OxygenBasic
  1.  
  2. /*
  3. BOOL WINAPI CreateProcess(
  4. 1  __in_opt     LPCTSTR lpApplicationName,
  5. 2  __inout_opt  LPTSTR lpCommandLine,
  6. 3  __in_opt     LPSECURITY_ATTRIBUTES lpProcessAttributes,
  7. 4  __in_opt     LPSECURITY_ATTRIBUTES lpThreadAttributes,
  8. 5  __in         BOOL bInheritHandles,
  9. 6  __in         DWORD dwCreationFlags,
  10. 7  __in_opt     LPVOID lpEnvironment,
  11. 8  __in_opt     LPCTSTR lpCurrentDirectory,
  12. 9  __in         LPSTARTUPINFO lpStartupInfo,
  13. 10 __out        LPPROCESS_INFORMATION lpProcessInformation
  14. );
  15. */
  16.  
  17.  
  18.   sys hchw[128],nchw 'child windows
  19.  
  20.  
  21.   function Exec(string s)
  22.   '======================
  23.  STARTUPINFO infs
  24.   PROCESS_INFORMATION infp
  25.   string fi="_.o2bas"
  26.   putfile fi,s
  27.   CreateProcess "co2.exe","co2.exe "+fi ,0,0,0,0,0,0,@infs,@infp
  28.   CloseHandle infp.hProcess
  29.   CloseHandle infp.hThread
  30.   end function
  31.  

Charles