I want to link c++ to GAMS software using createprocess() function. I used this code but it just opens the GAMS software. I want that the programe run a file.gms automatically after openning the GAMS software:
STARTUPINFO si;
PROCESS_INFORMATION pi;
ZeroMemory(&si, sizeof(si));
si.cb = sizeof(si);
ZeroMemory(&pi, sizeof(pi));
if(CreateProcessW(L"C:\\PROGRA~1\\gams23.3\\gamside.exe",NULL,NULL,NULL,false,0,NULL,NULL,&si,&pi))
{
WaitForSingleObject(pi.hProcess, 10000 );
CloseHandle( pi.hProcess );
CloseHandle( pi.hThread );
}
Please help me. Thanks so much.