I have read this and achieved the opening of my C# application. My C# application opens a folder and draws a graph. Is it possible for me to tell my C# application which folder to open from C++ and then once the graph is seen and the C# program is closed, it returns back to the C++ app.
Edit: Thanks Matthew I got it working.
Another query in relation to my CreateProcess lpCommandLine variable: (Below is the code)
CString sFolderPath = "C:\Documents and Settings\...";
int nStrBuffer = sFolderPath.GetLength() + 50;
LPTSTR szParam = _tcsdup(sFolderPath.GetBuffer(nStrBuffer));
nRet = ::CreateProcess(szCmdline,// pointer to name of executable module
szParam,// pointer to command line string
NULL,// pointer to process security attributes
NULL,// pointer to thread security attributes
FALSE,// handle inheritance flag
DETACHED_PROCESS,// creation flags
NULL,// pointer to new environment block
NULL,// pointer to current directory name
&sui,// pointer to STARTUPINFO
&pi );// pointer to PROCESS_INFORMATION
I get the variable szParam properly, but when the application opens up, the complete filename is not copied across. For eg: In the above case, only " and Settings...." is copied across where as the "C:\Documents" part is left behind. Could you point out on my mistake please?
C# implementation:
[STAThread]
static void Main(string[] args)
{
foreach (string result in args)
{
MessageBox.Show(result);
}
}