Click here to Skip to main content
15,892,537 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: templates Pin
Michael Dunn7-Feb-06 7:17
sitebuilderMichael Dunn7-Feb-06 7:17 
QuestionActiveX with Visual Studio 6.0 Pin
MrChefman7-Feb-06 4:28
MrChefman7-Feb-06 4:28 
AnswerRe: ActiveX with Visual Studio 6.0 Pin
Anilkumar K V7-Feb-06 18:27
Anilkumar K V7-Feb-06 18:27 
GeneralRe: ActiveX with Visual Studio 6.0 Pin
MrChefman7-Feb-06 22:39
MrChefman7-Feb-06 22:39 
QuestionSDI with multiple document templates Pin
mark gooding7-Feb-06 4:23
mark gooding7-Feb-06 4:23 
AnswerRe: SDI with multiple document templates Pin
mark gooding7-Feb-06 23:27
mark gooding7-Feb-06 23:27 
QuestionRRAS Administration DLL - Win Server 2003 blues Pin
Dave Townson7-Feb-06 3:58
Dave Townson7-Feb-06 3:58 
QuestionCreateProcess issue Pin
Spiros7-Feb-06 3:56
Spiros7-Feb-06 3:56 
I am using the following code in order to start an MFC Win application from another MFC win application that is currently running:

int CTransfer::StartNewProcess(CString szNewProcess)
{
STARTUPINFO si;
PROCESS_INFORMATION pi;
char szProcess[128];

szNewProcess += ".exe";
strcpy(szProcess , (LPCTSTR)szNewProcess);

ZeroMemory( &si, sizeof(si) );
si.cb = sizeof(si);
ZeroMemory( &pi, sizeof(pi) );


// Start the child process.
if( !CreateProcess( NULL, // No module name (use command line).
szProcess, // Command line.
NULL, // Process handle not inheritable.
NULL, // Thread handle not inheritable.
TRUE, // Set handle inheritance to FALSE.
NORMAL_PRIORITY_CLASS, // No creation flags.
NULL, // Use parent's environment block.
NULL, // Use parent's starting directory.
&si, // Pointer to STARTUPINFO structure.
&pi ) // Pointer to PROCESS_INFORMATION structure.
)
{
return 1;
}



// Wait until child process exits.
WaitForSingleObject( pi.hProcess, INFINITE );

// Close process and thread handles.
CloseHandle( pi.hProcess );
CloseHandle( pi.hThread );

return 0;
}

The idea is that while the called window (modal) will be open the caller/creator will wait inactive until the user exits. This code will work with no issue under Win2000 and VS 2003. When I converted the projects to VS 2005 and I run them under Win 2003 I have the following strange bahaviour. The new window will show up but after a few seconds the caller will start processing/doing something because the mouse cursor will change to an hourglass. In addition to that in the Task Manager I can see two instances of the caller. So when I do Goto Process for each one of them, one will point to the caller.exe and the second one will point to the explorer.exe. I even created two new projects, because I thought that the conversion of the projects from 2003 to 2005 had the problem, but the bahviour is the same. If you have any idea / suggestion please let me know. Thank you in advance for your time.


Spiros Prantalos
Miami the place to be!!
QuestionRe: CreateProcess issue Pin
David Crow7-Feb-06 4:04
David Crow7-Feb-06 4:04 
AnswerRe: CreateProcess issue Pin
Joel Lucsy7-Feb-06 4:49
Joel Lucsy7-Feb-06 4:49 
Questionudp socket Pin
yamunasenthilvel7-Feb-06 3:41
yamunasenthilvel7-Feb-06 3:41 
QuestionCRichEditCtrl::SetParaFormat question ... Pin
Maximilien7-Feb-06 3:40
Maximilien7-Feb-06 3:40 
AnswerRe: CRichEditCtrl::SetParaFormat question ... Pin
-Dy7-Feb-06 3:50
-Dy7-Feb-06 3:50 
GeneralRe: CRichEditCtrl::SetParaFormat question ... Pin
Maximilien7-Feb-06 4:29
Maximilien7-Feb-06 4:29 
AnswerRe: CRichEditCtrl::SetParaFormat question ... Pin
James R. Twine7-Feb-06 7:09
James R. Twine7-Feb-06 7:09 
QuestionFormatted log/message window ... Pin
Maximilien7-Feb-06 2:45
Maximilien7-Feb-06 2:45 
AnswerRe: Formatted log/message window ... Pin
James R. Twine7-Feb-06 3:05
James R. Twine7-Feb-06 3:05 
QuestionLost in Loading toolbars and Images Pin
Aravind Badrinath Krishnan7-Feb-06 2:38
Aravind Badrinath Krishnan7-Feb-06 2:38 
QuestionAny tool for finding Resource leaks? Pin
Raghava Kumar.G7-Feb-06 2:00
Raghava Kumar.G7-Feb-06 2:00 
AnswerRe: Any tool for finding Resource leaks? Pin
Blake Miller7-Feb-06 6:10
Blake Miller7-Feb-06 6:10 
QuestionFunction references Pin
Dimitris Vikeloudas7-Feb-06 1:45
Dimitris Vikeloudas7-Feb-06 1:45 
AnswerRe: Function references Pin
toxcct7-Feb-06 1:49
toxcct7-Feb-06 1:49 
AnswerRe: Function references Pin
Stephen Hewitt7-Feb-06 2:07
Stephen Hewitt7-Feb-06 2:07 
GeneralRe: Function references Pin
toxcct7-Feb-06 3:56
toxcct7-Feb-06 3:56 
GeneralRe: Function references Pin
Stephen Hewitt7-Feb-06 11:09
Stephen Hewitt7-Feb-06 11:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.