how to abort application
-
Hi, In my application I am using Active Sync to connect my PC to Mobile(Windows Mobile).I am using CeCreateProcess() function to invoke exe in mobile.I need to abort my application. For that I have created one button on my dialog.I have added event handler to that.I have added
PostQuitMessage(0);
while running the application If I click on "Abort" button application is not closing at that point.After completion of present running task only application is closing. For example I am executing testcycle.In the middle I need to abort my application.Can anyone help me. Rekha.
-
Hi, In my application I am using Active Sync to connect my PC to Mobile(Windows Mobile).I am using CeCreateProcess() function to invoke exe in mobile.I need to abort my application. For that I have created one button on my dialog.I have added event handler to that.I have added
PostQuitMessage(0);
while running the application If I click on "Abort" button application is not closing at that point.After completion of present running task only application is closing. For example I am executing testcycle.In the middle I need to abort my application.Can anyone help me. Rekha.
The clue is in the api command's name.
PostQuitMessage (0)
. It POSTs a WM_QUIT message to the message queue. This is a signal for your message loop to exit. While you are still in a function, you're not handling messages... so you don't quit. ie:
void CMyApp:OnSomeButton ()
{
PostQuitMessage (0);
Sleep (10000);
}will take 10 seconds before it even could quit. Not knowing what you're doing, that's as helpful as I can be at the moment.
In the process of moving to Sweden for love (awwww). If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), give me a job!
-
Hi, In my application I am using Active Sync to connect my PC to Mobile(Windows Mobile).I am using CeCreateProcess() function to invoke exe in mobile.I need to abort my application. For that I have created one button on my dialog.I have added event handler to that.I have added
PostQuitMessage(0);
while running the application If I click on "Abort" button application is not closing at that point.After completion of present running task only application is closing. For example I am executing testcycle.In the middle I need to abort my application.Can anyone help me. Rekha.
-
The clue is in the api command's name.
PostQuitMessage (0)
. It POSTs a WM_QUIT message to the message queue. This is a signal for your message loop to exit. While you are still in a function, you're not handling messages... so you don't quit. ie:
void CMyApp:OnSomeButton ()
{
PostQuitMessage (0);
Sleep (10000);
}will take 10 seconds before it even could quit. Not knowing what you're doing, that's as helpful as I can be at the moment.
In the process of moving to Sweden for love (awwww). If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), give me a job!
Hi, In my Application I am connecting to Mobile and sending data to Mobile from my computer using socket.And I am receiving information from Mobile. If I click on Abort button I need to stop Application.I am using MFC. Can I use PostQuitMessage(0) for this?
-
-
Hi, In my Application I am connecting to Mobile and sending data to Mobile from my computer using socket.And I am receiving information from Mobile. If I click on Abort button I need to stop Application.I am using MFC. Can I use PostQuitMessage(0) for this?
hemlat wrote:
Can I use PostQuitMessage(0) for this?
YES. Now go and read my message again - it won't stop straight away. If you do many other things after the PostQuitMessage command, it will do them first. Iain.
In the process of moving to Sweden for love (awwww). If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), give me a job!
-
Hi, In my application I am using Active Sync to connect my PC to Mobile(Windows Mobile).I am using CeCreateProcess() function to invoke exe in mobile.I need to abort my application. For that I have created one button on my dialog.I have added event handler to that.I have added
PostQuitMessage(0);
while running the application If I click on "Abort" button application is not closing at that point.After completion of present running task only application is closing. For example I am executing testcycle.In the middle I need to abort my application.Can anyone help me. Rekha.
it seems to dialog based application, why don't your try EndDialog() api!
"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
-
it seems to dialog based application, why don't your try EndDialog() api!
"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
-
call EndDialog there only!
"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