CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2000
    Posts
    154

    Exclamation Close gracefully when crashing?

    How to close a C# application gracefully when crashes or end-process by task manager?

    This C# application is a COM client & the COM server is C++ which runs as a Service. When C# client crashes or end-process, it doesn't call the COM object's destructor. So the Server keeps that object as a live one.
    Any suggestion?

    (If the client is closed gracefully, it calls the destructor of COM object. So the Server knows the object is no longer available.)

  2. #2
    Join Date
    Oct 2002
    Location
    Timisoara, Romania
    Posts
    14,360

    Re: Close gracefully when crashing?

    First, your application should not crash. If it crashes it means your not handling exceptions appropriately.

    As for TerminateProcess, I guess this explanation is good enough: http://blogs.msdn.com/oldnewthing/ar...22/191123.aspx.
    Marius Bancila
    Home Page
    My CodeGuru articles

    I do not offer technical support via PM or e-mail. Please use vbBulletin codes.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured