Bsbosa.com
07-13-2010, 04:07 AM
Hi, In my MFC application,im invoking one console application,using ShellExecuteEx() and im passing value like "MODEL" to that console application and im receiving this string using argv[] in console application.
Like the same way, i want to receive one string from console applciation to MFC.
How can i do that?Pls help me..
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();
} Anu
Like the same way, i want to receive one string from console applciation to MFC.
How can i do that?Pls help me..
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();
} Anu