Electronics, PCB Design and PCB Layout Daycounter, Inc.
Engineering Services

Custom Firmware, Electronics Design, and PCB Layout

                 
 

Water Level Sensor







 

CreateProcess Example

The CreateProcess function command line is parameter is non-intuitive.  For typical C style functions, the first parameter is normally the name of the program.  Therefore when you invoke a program with arguments, the command line parameter doesn't start with an argument but should start with the name of  the program. 

 

Code Example:

    PROCESS_INFORMATION pi;
    STARTUPINFO si;


    memset(&si,0,sizeof(si));
    si.cb= sizeof(si);
    _tcscpy(cmdline,_T("MyProgram.exe /param1"));        // note the non-intuitive first parameter. 
    _tcscpy(programpath,_T("MyProgram.exe"));
    if(!CreateProcess(programpath, cmdline, NULL, NULL, false, 0, NULL,NULL,&si,&pi)) {
        AfxMessageBox(_T("Could not run the program."));
        return false;
    }

 

Daycounter specializes in contract electronics design.  Do you need some help on your project?  Contact us to get a quote. 

 

[Employment] [Downloads] [Articles] [Contact Us]

Salt Lake City, UT, USA

Disclaimer: Daycounter, Inc. doesn't guarantee the accuracy of any of it's content. Use at your own risk.

© Copyright 2016 Daycounter, Inc. All rights Reserved.






Soil Moisture Sensor Probe