Hi, Im invoking console application from my MFC application through ShellExecuteEx(). After the exe get loading,i want to receive one test string form console apllication to MFC,if i cannot receive the string then i will close both MFC and Console application.
For this,i want to send any string or valu from console application to MFC. I dont know how to do that.
char szFile[20]={0},szDir[500]={0};
memset(szFile,0,20);
memset(szDir,0,500);
strcpy(szFile,szModelName);
strcat(szFile,".EXE");
sInfo.lpFile = szFile;
sInfo.hwnd = NULL;//this;
sInfo.lpParameters ="MODEL";
strcat(szDir,"\\Sources\\");
sInfo.lpDirectory = szDir;
sInfo.fMask = SEE_MASK_NOCLOSEPROCESS;
sInfo.cbSize = sizeof(SHELLEXECUTEINFO);
sInfo.lpVerb = "open";
sInfo.nShow = SW_HIDE;
sInfo.hwnd = NULL;
BOOL bFlag = ShellExecuteEx(&sInfo);
Console application coding
int main( int argc , char *argv[] )
{ char str[50];
strcpy(str,argv[1]);
getch();
}