Cart New Account Login

HomeAbout usProductsSupportForumsBlogCustomer Service
   Home P&E Customer Support FAQs - Frequently Asked Questions FAQ ID # 28
FAQ ID # 28
I am interested in launching the CPROGxx command-line flash programmer from my own application, and reading the resultant error code. Is there some simple way to do this from a Windows based application?
The Microsoft WIN32 API has several calls which allow you to launch an application(CreateProcess), check it's status (GetExitCodeprocess) until it completes, and then read back the resulting error code(GetExitCodeprocess). An error code of zero indicates successful programming. An example written in Delphi is shown as follows, and a similar approach can be used from Microsoft Visual C and any other development language which has access to the WIN32 API.

To launch the application:

with dummystartup do
      cb := sizeof(TstartupInfo);
      lpreserved := NIL;
      lpDesktop := NIL;
      lpTitle := NIL;
      dwFlags := 0;
      cbReserved2 := 0;
      lpReserved2 := NIL;


To check the status and error code:

      GetExitCodeprocess(currentprocess.hprocess, theExitCode);
      until Application.Terminated or (theexitcode<>STILL_ACTIVE);

Related Downloads
Architectures Categories Products
HC08, HCS08, HC(S)12(X), 68HC16, CPU3xx, ColdFire V2/V3/V4, Power MPC5xx/8xx, Qorivva MPC5xxx, RS08, ColdFire V1, Kinetis / S32, DSC, S12Z, LPC, STM32, SPC5, STM8, i.MX, ARM-based Flash Programming Software CPROG08SZ, PROGHCS08, PROG12Z, PROG16Z, PROG32Z, PROGCFZ, PROGMCZ, PROGPPCZ, PROGRS08, CYCLONE_MAX_REPLACE, UNIT12Z-LINUX-DIST, DEMO9S08QE8, XPC563MADPT144S, XPC563MADPT208S
Please rate this FAQ to help us improve our support
0 means "not helpful"
10 means "very helpful"
0 1 2 3 4 5 6 7 8 9 10

© 2021 P&E Microcomputer Systems Inc.
Website Terms of Use and Sales Agreement