Good reply Sly!! I hope you like the appending to my sig, and suggest you copy! The colors really bring out your eyes!
spiky1 - lots of people won't look at your code unless you wrap code tags around it -
Code:
switch (Status)
{
case RFX_SUCCESS:
char strLog[20];
char strLoader[256];
char *pFind;
int lLength;
char *strLoaderPath;
strLoaderPath = getenv("BSI_CF_DIR");
if (Request.APIType == RFX_USE_RF_API) {
pFind = strstr(strLoaderPath, "loader1.exe");
if (pFind == NULL){
strcat(strLoaderPath, "\\loader1.exe ");}
}
else {
pFind = strstr(strLoaderPath, "loader2.exe");
if (pFind == NULL){
strcat(strLoaderPath, "\\loader2.exe ");}
}
itoa(Request.RequestNumber,strLog,10);
strcat(strLoader, strLog);
strcat(strLoader, " ");
strcat(strLoader, Request.DataSetID);
STARTUPINFO si;
::ZeroMemory(&si, sizeof(STARTUPINFO));
si.cb = sizeof(STARTUPINFO);
PROCESS_INFORMATION pi;
lLength = CreateProcess(NULL,strLoader,NULL,NULL,FALSE,CREAT E_NEW_CONSOLE,NULL,NULL,&si, &pi);
if (! lLength){
error("CreateProcess failed");}
break;
}