[mfc] restart other process
-
hello, i created 2 c++ applications, one is win32 and other is mfc. i want to restart the win32 process using mfc application. please tell me how to do this ?? also i want to run only 1 instance of process of both the processes. please suggest ?? btw thanks.
-
hello, i created 2 c++ applications, one is win32 and other is mfc. i want to restart the win32 process using mfc application. please tell me how to do this ?? also i want to run only 1 instance of process of both the processes. please suggest ?? btw thanks.
rahuljin wrote:
i created 2 c++ applications, one is win32 and other is mfc. i want to restart the win32 process using mfc application. please tell me how to do this ?? also i want to run only 1 instance of process of both the processes. please suggest ??
killprocess and startexecute
-
hello, i created 2 c++ applications, one is win32 and other is mfc. i want to restart the win32 process using mfc application. please tell me how to do this ?? also i want to run only 1 instance of process of both the processes. please suggest ?? btw thanks.
1. CreateProcess[^] or ShellExecute[^] 2. Google is your friend, but look at this[^].
> The problem with computers is that they do what you tell them to do and not what you want them to do. < > Life: great graphics, but the gameplay sux. <
-
1. CreateProcess[^] or ShellExecute[^] 2. Google is your friend, but look at this[^].
> The problem with computers is that they do what you tell them to do and not what you want them to do. < > Life: great graphics, but the gameplay sux. <
-
rahuljin wrote:
i created 2 c++ applications, one is win32 and other is mfc. i want to restart the win32 process using mfc application. please tell me how to do this ?? also i want to run only 1 instance of process of both the processes. please suggest ??
killprocess and startexecute
-
Sorry, i thought by "restart" you meant that the process got killed/exited by someone else, for example by a user action and you wanted to restart it again.
> The problem with computers is that they do what you tell them to do and not what you want them to do. < > Life: great graphics, but the gameplay sux. <
-
hello, i created 2 c++ applications, one is win32 and other is mfc. i want to restart the win32 process using mfc application. please tell me how to do this ?? also i want to run only 1 instance of process of both the processes. please suggest ?? btw thanks.
I just replied to your yesterday's post. Ignore it. Answer me here: What *exactly* are you trying to achieve. Why restart a Win32 Process? Why use both Win32 and MFC? None of this makes sense to me. We may probably be able to suggest you a much better way of doing it, but only if you explain what are you trying to do.
It is a crappy thing, but it's life -^ Carlo Pallini
-
I just replied to your yesterday's post. Ignore it. Answer me here: What *exactly* are you trying to achieve. Why restart a Win32 Process? Why use both Win32 and MFC? None of this makes sense to me. We may probably be able to suggest you a much better way of doing it, but only if you explain what are you trying to do.
It is a crappy thing, but it's life -^ Carlo Pallini
sorry but i could not find my old question. i created the win32 c++ application long back when i dont have any idea of mfc. it is working fine. with mfc, i create a gui which accept the some content and save them in text files. these text files are then used by the win32 application. win32 application runs at startup of windows and it takes the information from the files and starts using it (it is socket application so it will not read the file again until it receives some information for the ip which is saved in the text file). so i want to restart the win32 application when closing mfc application so that win32 application can use the updated text files. actually i want to use TerminateProcess() and then start it with CreateProcess() function. but i read that TerminateProcess() can create problem with DLL structure.
-
sorry but i could not find my old question. i created the win32 c++ application long back when i dont have any idea of mfc. it is working fine. with mfc, i create a gui which accept the some content and save them in text files. these text files are then used by the win32 application. win32 application runs at startup of windows and it takes the information from the files and starts using it (it is socket application so it will not read the file again until it receives some information for the ip which is saved in the text file). so i want to restart the win32 application when closing mfc application so that win32 application can use the updated text files. actually i want to use TerminateProcess() and then start it with CreateProcess() function. but i read that TerminateProcess() can create problem with DLL structure.
How hard is it to add MFC support to the console application and send a message to it so that it reads the new file again in response to the message? I understand you are having a trouble communicating from your MFC app to the console app?
It is a crappy thing, but it's life -^ Carlo Pallini
-
How hard is it to add MFC support to the console application and send a message to it so that it reads the new file again in response to the message? I understand you are having a trouble communicating from your MFC app to the console app?
It is a crappy thing, but it's life -^ Carlo Pallini
the win32 application is not a console application. i dont know how to communication between the two application can be set. in vs2008, i used win32 project (not win32 console application) for creating the win32 application. also the header files used are ---
#include <windows.h>
#include <winsock.h>
#include <tchar.h>
#include <wchar.h>
#include <iostream>
#include <fstream>
#include <shlwapi.h> -
How hard is it to add MFC support to the console application and send a message to it so that it reads the new file again in response to the message? I understand you are having a trouble communicating from your MFC app to the console app?
It is a crappy thing, but it's life -^ Carlo Pallini
Rajesh R Subramanian wrote:
How hard is it to add MFC support to the console application and send a message to it so that it reads the new file again in response to the message
Can't u send message to Win32 application ?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
Never mind - my own stupidity is the source of every "problem" - Mixturecheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You
-
the win32 application is not a console application. i dont know how to communication between the two application can be set. in vs2008, i used win32 project (not win32 console application) for creating the win32 application. also the header files used are ---
#include <windows.h>
#include <winsock.h>
#include <tchar.h>
#include <wchar.h>
#include <iostream>
#include <fstream>
#include <shlwapi.h>Does you application contain or create a window. If yes, you can use Window Messaging to communicate between two application, just add common message id between two application, and related function in WndProc function for win32 application and between BEGIN_MESSAGE_MAP and END_MESSAGE_MAP for MFC application.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
Never mind - my own stupidity is the source of every "problem" - Mixturecheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You
-
Rajesh R Subramanian wrote:
How hard is it to add MFC support to the console application and send a message to it so that it reads the new file again in response to the message
Can't u send message to Win32 application ?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
Never mind - my own stupidity is the source of every "problem" - Mixturecheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You
Not if it is a console application.
It is a crappy thing, but it's life -^ Carlo Pallini
-
the win32 application is not a console application. i dont know how to communication between the two application can be set. in vs2008, i used win32 project (not win32 console application) for creating the win32 application. also the header files used are ---
#include <windows.h>
#include <winsock.h>
#include <tchar.h>
#include <wchar.h>
#include <iostream>
#include <fstream>
#include <shlwapi.h>You could send the win32 app a message and a message handler to it. There are several tutorials on IPC in CP, just take a look at those.
It is a crappy thing, but it's life -^ Carlo Pallini
-
Does you application contain or create a window. If yes, you can use Window Messaging to communicate between two application, just add common message id between two application, and related function in WndProc function for win32 application and between BEGIN_MESSAGE_MAP and END_MESSAGE_MAP for MFC application.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
Never mind - my own stupidity is the source of every "problem" - Mixturecheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You
-
Not if it is a console application.
It is a crappy thing, but it's life -^ Carlo Pallini
Rajesh R Subramanian wrote:
Not if it is a console application.
Humm... we can send window message to container window then :-)
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
Never mind - my own stupidity is the source of every "problem" - Mixturecheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You
-
Not if it is a console application.
It is a crappy thing, but it's life -^ Carlo Pallini
Sorry if my comment hurt. That’s not intentional.. i think you felt bad.. my apology!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
Never mind - my own stupidity is the source of every "problem" - Mixturecheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You
-
Sorry if my comment hurt. That’s not intentional.. i think you felt bad.. my apology!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
Never mind - my own stupidity is the source of every "problem" - Mixturecheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You
I don't see what's there in your post to hurt me. I also don't know why do you felt that I was hurt. :)
It is a crappy thing, but it's life -^ Carlo Pallini