Close Application

Hi all,
I am running a MFC application using threads. The prog. is running
fine. It is multithreaded prog. hence one thread wait for another. When

I kill the process from TASK MANAGER, my prog's ExitInstance didn't get

called. I want to do some cleanup. where should I put that cleanup
code? Please help me

0
10/14/2005 7:13:53 AM
vc.mfc 33608 articles. 0 followers. Follow

2 Replies
495 Views

Similar Articles

[PageSpeed] 15

Would it be presumptuous to ask why you have to kill your app using task
manager rather than pushing the close button in the top right hand corner of
the app?

"Suriya" <aktersuriya@gmail.com> wrote in message
news:1129274033.213757.249570@g44g2000cwa.googlegroups.com...
>
> Hi all,
> I am running a MFC application using threads. The prog. is running
> fine. It is multithreaded prog. hence one thread wait for another. When
>
> I kill the process from TASK MANAGER, my prog's ExitInstance didn't get
>
> called. I want to do some cleanup. where should I put that cleanup
> code? Please help me
>


0
kma1 (58)
10/14/2005 7:33:36 AM
Hi,

It's normal that ExitInstance does not get called when you 
"kill" it by Task Manager. The reason is that Task Manager
uses TerminateProcess function to terminate a process from
its list of processes.

The process being terminated is given absolutely no notification
that it is dying—the application cannot clean up properly
and cannot prevent itself from being killed (except by normal 
security mechanisms). For example, the process cannot flush any
information it might have in memory out to disk.

That's why ExitInstance does not get called.

-- 
======
Arman

0
armancho_x1 (249)
10/14/2005 8:43:02 PM
Reply:

Similar Artilces:

Publisher 2003 my inserted pictures disappear everytime I close t.
Everytime I close a pub. file with clip art or pictures inserted when re opening the file the pictures are not there.. the area is there I can see the handles but no pictures.. How can I stop this.. I have tried the graphics manager and they show there but not in my file on my page.. ezwez <ezwez@discussions.microsoft.com> was very recently heard to utter: > Everytime I close a pub. file with clip art or pictures inserted when > re opening the file the pictures are not there.. the area is there I > can see the handles but no pictures.. How can I stop this.. I have > trie...

Windows Task Manager Does Not show applications
I run Windows XP Svc Pak 3. Clicking Ctl/Alt/Del pulls up Task Manager, but no applications are shown on the applications tab. How is this fixed? No programs appear in Task Manager http://support.microsoft.com/kb/837900 "Rob" <Rob@discussions.microsoft.com> wrote in message news:C8BBBD3E-15CE-4FF1-9F3C-0267EECE67CB@microsoft.com... >I run Windows XP Svc Pak 3. Clicking Ctl/Alt/Del pulls up Task Manager, >but > no applications are shown on the applications tab. How is this fixed? > > "Bob" <bob@nowhere.net> wrote ...

Outlook doesn't close --> WMS Idle
From time to time in recent weeks, when I log out of Windows XP Pro (SP1 with all updates) I get an "End Program" error on "WMS Idle", with the system indicating it can't shut down WMS Idle. Whenever this occurs (it happens only intermitently), Task Manager shows that the OUTLOOK.EXE process is still running. However, the Outlook 2002 application (SP2 with all updates) has been closed. There are no other system symptoms or problems whatsoever and the only software updates done for many months are Windows and McAfee updates. Is anyone aware of a Windows update...

Login in my own application
Hello NG Imagine, I want to access the file \\192.168.20.40\SYSTEM\FILE.TXT from my own application. So far so good, but what if the remote system wants me to authenticate before? How can I login with username and password (without manually using the explorer)? Regards Eunet Hi Eunet , when you are sure that the remote system will ask you for credentials then you must do a context swich inside you application, impersonating the application with the expected user Context to get the expected access token. These are the fundamental steps to do thiswith the help of the Widows Security A...

Adding <?mso-application ...> programmatically
Hi, If I have an XmlDocument DOM how do I insert <?mso-application progid="ProgId.Here"?> programmatically? -- Victor Hadianto http://www.synop.com/Products/SauceReader/ "Victor Hadianto" <synop@nospam.nospam> wrote in message news:06AEA580-5F3B-4283-8D74-76EB75F61697@microsoft.com... > If I have an XmlDocument DOM how do I insert > <?mso-application progid="ProgId.Here"?> programmatically? Given an already positioned XmlNode, you can call the XmlDocument's CreateProcessingInstruction( ) and use InsertBefore( ), InsertAfter( ) o...

Laplink for Netbooks to move applications?
Has anyone used the $29.95 "Laplink for netbooks" to move selected applications from an older XP to a netbook also running XP? I have an old (2002) HP laptop that I want to retire, but have kept because it has 5 or 6 irreplaceable applications that I either downloaded or have lost the CDs. TIA, Paul "Paul H" <NoSpamphobergNoSpam@att.net> said this in news item news:Og5l$W7kKHA.4872@TK2MSFTNGP05.phx.gbl... > Has anyone used the $29.95 "Laplink for netbooks" to move selected > applications from an older XP to a netbook also running XP? ...

Application crash
Sometimes the application crash. In Eventvwr I see : Event ID: 1000 Origin: Microsoft Office 10 Description: Faulting application outlook.exe, version 10.0.4024.0, faulting module unknown, version 0.0.0.0, fault address 0x0665bb30 ---- and : ---- Event ID: 1001 Origin: Microsoft Office 10 Description: Fault bucket 28668605 ...

Getting application copy of printer DEVMODE
The input parameter pDevMode is always NULL in DrvDeviceCapibilities() for wCapability values DC_BINS and DC_BINNAMES. I need an application copy of printer devmode in this case. I tried using GetPrinter(), but it gave me the default devmode(the one set from Printer & Faxes). Does anyone know how do to that? (Application copy of devmode will have the devmode values set in application.) Here, I am using Word 2003 & Word 2002. These two always gives pDevmode=NULL for wCapability values DC_BINS and DC_BINNAMES. However, Word 2007 gives the correct DEVMODE values...

Email sent via Exchange instead of external SMTP from within applications
Outlook 2002 in an Exchange 5.5 environment. User also has a POP3&SMTP account configured. When creating a new email message, user can select the external SMTP account to send the message no problem. This works great. However, when user is inside any windows application, like Word, Excel or even just in Windows Explorer browsing files, and chooses to Send File, Outlook 2002 insists on using Exchange. Even when user specifies to use the external SMTP account and Outlook 2002 says it will use the external account, it doesn't. Email still goes out Exchange. Have changed the default...

Closing billing cycle #2
I'm getting an error message when I close the billing cycle that 4 customers are out of balance and it won't let me close any accounts. I've looked at the customers and I can't see anything wrong with them. Any suggestions? Basically what it is telling is that your the Accounts Receivable and the Last Closing Balance for those 4 customers do not match. You need to make them equal, in order to do that you need to make note of the Accounts Receivable Balance and the Customer Account Number from the error message. Then run this SQL statement in SO Admin UPDATE Customer SET ...

Closed accounts show up in Reports
I see other posts for this and none of the supposed answers seem to fix my problem, at least permanently. I have one online account that is actually tied to 3 at my bank. All three accounts show up in money. One of these accounts is just an account I monitor, so I don't want it's transactions listed with mine during calculations. I have "closed" the account in money. I have unselected the options for this account to 1) Include this account in the budget planner and 2) Use this account for budgeted savings goals. None of these fix my issue (see post title). I not...

Confirming property sheet closing in VC8
I want to be able to confirm with the user that the he wants to close the property sheet (which is in wizard mode) when he clicks Cancel. I've found a lot of posts about this, which are useless, probably because the old techniques are out-of-date, which would really suck for compatibility. Here's all the stuff I've tried to handle: CPropertySheet::ON_WM_SYSCOMMAND //doesn't even get called on Cancel CPropertySheet::ON_WM_CLOSE //doesn't even get called on Cancel CPropertySheet::OnNotify() //doesn't even get called on Cancel CPropertyPage::OnWizardFinish() //doesn&#...

What's a dialog box? How do I close it?
In Outlook, when I try to send a message, I get a window that says: "Open dialog box. Close dialog box and try again." I have no idea how to close a dialog box. What are you doing when you are sending the message? a dialog box is a message box reminding you to do something or telling you of problems. See if you can bring it forward using Alt+Tab. -- Diane Poremsky [MVP - Outlook] Author, Teach Yourself Outlook 2003 in 24 Hours Coauthor, OneNote 2003 for Windows (Visual QuickStart Guide) Need Help with Common Tasks? http://www.outlook-tips.net/beginner/ Outlook 2007: http://ww...

How to close Outlook Express for Outlook email
I recently installed Office 2003 and want to go from Outlook Express to Outlook. My problem is how to close Express so OUTLOOK is my default. I've gone to OUTLOOK tools/options/other and clicked on the default, however, I still only receive in Express. Thanks for any help. Have to set up the E-mail account in Outlook Regards Ash. ...

deleting a closed batch
Hi There, finally ready to start using the system live and like a dummy I tested the Z report and closed a batch. I didn't realize that there was some transacations (items subsequently deleted). So before I start I was hoping to just delete the batch (not posted yet) so that I can start fresh. I realize that this would not be a typical occurrence, and could be dangerous. Should I just do a manual "refund" of blank items for the previous batch? Or maybe just close a billing cycle? thanks Hi Kevin - you could simply delete all transactions in your database using the del...

Underlying connection was closed. Remote name could not be resolve
Hi, I am trying to add a webservice.I provide a reference to the wsdl file on the server. It works fine when I compile the code on my machine. But on the server, I get the above error with the same compiled code. UNDERLYING CONNECTION WAS CLOSED.REMOTE NAME COULD NOT BE RESOLVED. I read some of the articles which indicate a problem with the proxy server but our client does not have any proxy server. Their server is behind a firewall though. Any help would be greatly appreciated. Thanks ...

Should closed accounts be temporarily "opened" before running Salv.exe?
I ran the salvage routine and noticed that repairs were not made to accounts that were closed. I have gone through the process of installing M04 then retreating back to M02 a couple of times already in experimenting, and would like to know if this condition would make a difference before embarking on the procedure once more. The corruption issue on my M02 open accounts is nicely fixed, but crosslinks are broken and account balances still do not match on closed accounts after running the salvage routine. I only noticed this problem after my last conversion. Thanks for the feedback. John ...

Integrate 3rd Party Financial Application
Hi there, Is there a howto / best practices guide on how one would integrate a non-Great Plains financial application into MSCRM? Eg: Populating CRM Orders from Fin Application Eg: Would it be preferrable to actually populate the CRM Database with this information or only have it populate at runtime when an order is accessed for an account? This is crucial for the 360 Degree view of the customer... TIA :) Hi There is no out of the box solution. If you got programming skills you might be able to do it yourself. What the leading program would be is up to the programmer. Microsoft kno...

No Office 2004 applications will run
So far I have not had any luck solving this problem and Microsoft wasn't sure of a fix. If I log in under any pre-existing account (other than root), no Office applications will run. When I try to start Entourage or PowerPoint I get the following error message: Application Launch Failure The application "Entourage" could not be launched because of a shared library error: "<Microsoft Entourage><><><>" Word and Excel start but when I try to work on a document the application quits and that error comes up. I have run the Remove Office program o...

Year-end Closing entry
I have a client that has closed their 2008 year. The 2009 opening balances are correct. In one account (possibly more), the BBF entry has a Debit and Credit, which i haven't seen before; AND, these amounts are different from the 2008 ending balances. No Prior Period Adjustments have been made. I ran a Smartlist and it shows that the BBF entries were duplicated. Any insight would be great. Thanks, -- JB Hi JB, Go to GL20000 table and check for that account and period 0, how many entries can you see. Thanks "JB" wrote: > I have a client that has closed their 2008 y...

setting auto send/receive on closing outlook
I am trying to find the setting to set this for all users on a terminal server. ive tried making a new mst file with the proper settings but it dosent seem to use the last pages from the CIW ,when starting outlook. tried to make an PRF file and added it but still the settings for preforming send/receive wont change. is there another way ? registry or some other tools that can be used any advice or tips is appreciated (ps sorry about the rusty english ) ...

"Freezing" Timesheets once the Period has been closed
Is there anyway that timesheets can be locked to prevent users from recalling, updating, are resubmitting? If you running Project Server 2007 12.0.6317.5000 (KB953478) or above, users cannot do any of these things if you close the timesheet period. -- Stephen Sanderlin, Project MVP VP of Technology msProjectExperts For Project Server Consulting: http://www.msprojectexperts.com For Project Server Training: http://www.projectservertraining.com Read our blog at: http://www.projectserverhelp.com "Bonnie" <Bonnie@discussions.microsoft.com> wrote in message ...

Fatal error situation in Excel when trying to closing files which is an email attachment
After upgrading to Outlook and Excel 2002 SP2, I have many times experienced a fatal error situation in Excel when trying to close a file which is an email attachment . Except from this recurring fatal error situations, Excel works just fine. (Just wondered if this is related to using the Filter option?)) Thanks for any suggestions! Frank Krogh "Frank Krogh" <frank.krogh@sintef.no> wrote in news:1076421609.816059@halvan.trd.sintef.no: > After upgrading to Outlook and Excel 2002 SP2, I have many times > experienced a fatal error situation in Excel when trying to c...

Word application opens with outlook
Everytime I open Outlook 2003,it automatically opens Word, how can I stop this? Change the configuration in Outlook to *not* use Word as the editor. Hope this is useful to you. Let us know. rms ejones wrote: > Everytime I open Outlook 2003,it automatically opens Word, > how can I stop this? ...

namespace::ReleaseDispatch() hangs my client app if Outlook has been closed while my app is running
My C++ app uses the Outlook Object Model (OOM) to maniplate contacts in Microsoft Outlook. At the end of the manipulations, I do all the stuff necessary to shut down, i.e., m_oItems.ReleaseDispatch(); m_oFolder.ReleaseDispatch(); m_oNameSpace.Logoff(); /***/ m_oNameSpace.ReleaseDispatch(); But I have discovered that my app hangs infinitely on the line commented with /***/ above (or on whatever the first line is that references m_oNameSpace) anytime a separate running instance of the MS Outlook app has been *closed* during my app's processing using the OOM. I assume this is bec...