Derived1 d; // when I add this line I get assert
Never do this as it’s seriously flawed. The object d is on the stack but the stack is unwound when an exception is caught. The upshot is that when you catch an exception with such code the exception handler gets a pointer to an object which no longer exists. It's the same situation as returning a reference or pointer to a local variable from a function.
Probably you have seen "winrar" to add "Add to archive" type menuitem to default right-click pop-up menu. I want to add this feature to my file conversion software. After some searching on the internet, I think I have to modify the Windows Explorer context menu. I don't know how to do it. Does anyone know how to do it?
Bangladesh University of Engineering and Technology.
Before closing my application I write down the status of current working in some file.
But when the application gets closed after sudden electricity failure, how can I write down the status in a file at that time.
As Nimbu has said, QueryEndSession is the only way .. that too when the system is not being shut down abruptly. But if you still want to do, do one thing, write the staus in a remote computer.(i.e a Client machine), which gets data(status) from the server(the electrically-downed machine), now atleast you can write, *when* the system actually went down.
09:40:43-29/6/05 - Status X<br />
09:41:23-29/6/05 - Status Y<br />
(Now the server is down abrubtly)<br />
09:42:23-29/6/05 - Server Down, [Here the client will still be alive to say that he's down]<br />
Excellent Elaine, I didn't think of this idea. This would be the best option for him. But he must ensure that his UPS is enabled with communication port. Here in India, I find only APC providing that feature. That too not for the lower ends. I checked a model on the internet that had USB port, and I bought it home immediately. When I unpacked it, I found no *holes* around I got disappointed. I called the customer care, they said, it's available only with the Japanese model .