Well it looks like you downvoted me because you did not like my answer, or maybe the link I provided.
SrikanthSriSri wrote:
But with the same API ExitInstance() the exe is getting killed in customer version but not happening in developer version. Any Idea y ?
Yes, your code is wrong. The fact that it sometimes works under certain circumstances does not mean that the code is correct, only that the error is not showing up. If you took the time to refer to the link I posted you will see the following sentence:
The ExitInstance member function of class CWinApp is called each time a copy of your application terminates, usually as a result of the user quitting the application.
That suggests to me that calling this function does not necessarily terminate the program. A spell with the debugger should confirm this.