Untitled


SUBMITTED BY: Guest

DATE: Jan. 18, 2019, 1:43 a.m.

FORMAT: Text only

SIZE: 1.4 kB

HITS: 159

  1. bool DoCreateCharts( RPT_VIEW_MEMBER pMember )
  2. {
  3. CString strCommand;
  4. strCommand.Format( _T("\"%s\\ChartMaker.exe\" -p \"%s\" -r \"%s\""),
  5. CString( get_program_folder( ).string( ).c_str( ) ),
  6. GetProjectPathTitle() + ARS_EXTENTION,
  7. oProject.GetSPCurrentReport()->GetScreenName()
  8. );
  9. GetLastError();
  10. STARTUPINFO si;
  11. PROCESS_INFORMATION pi;
  12. ZeroMemory( &si, sizeof(si) );
  13. si.cb = sizeof(si);
  14. ZeroMemory( &pi, sizeof(pi) );
  15. // Start the child process.
  16. if( ! CreateProcess( NULL, // No module name (use command line).
  17. (LPSTR)(LPCTSTR)strCommand, // Command line.
  18. NULL, // Process handle not inheritable.
  19. NULL, // Thread handle not inheritable.
  20. FALSE, // Set handle inheritance to FALSE.
  21. 0, // No creation flags.
  22. NULL, // Use parent's environment block.
  23. NULL, // Use parent's starting directory.
  24. &si, // Pointer to STARTUPINFO structure.
  25. &pi ) // Pointer to PROCESS_INFORMATION structure.
  26. )
  27. {
  28. CString strErr;
  29. strErr.Format( _T("Could not start Chart Maker tool.\nerror: %s"), GetLastErrorStr( ) );
  30. AfxMessageBox( strErr );
  31. }
  32. WaitForSingleObject( pi.hProcess, INFINITE );
  33. // Close process and thread handles.
  34. CloseHandle( pi.hProcess );
  35. CloseHandle( pi.hThread );
  36. return true;
  37. }

comments powered by Disqus