They allow polymorphism, where derived classes can provide different behavior for the same function calls.
For example, a Shape class can have a virtual getArea () method.
Derived classes (like Circle, Square, etc...) will provide different implementations of getArea (), which use different formulas for the area calculation. Thus, you can call getArea () on a Shape object, regardless of which concrete derived class it represents, and you'll get the correct area.
<pre lang="text">Thanks a lot <b>Alan </b> I tried the following code. It is giving me the title of every open windows. But I want only the exception popup window( i.e. error windows generated from other applications) from them.How could I get this. Plz help me.</pre>
Without seeing those titles, I can't give you a way of distinguishing them. If the titles don't work, then using the windows' handles, you can probably get the applications or processes that own them. Then you can use this information to isolate the ones you want.
You cannot use GetLastError() in this way, it will only return the last error value in the current thread of your application. And even if you could somehow call it you would not get a valid response. I think you will find that this project is not viable.
Yet another useful error code from Microsoft. It is quite possible that your code is somehow trying to link to a 32 bit DLL; try using Dependency Walker to track all the dependencies. Other than that you should try the Microsoft help sites.
Please check the return value again. 0x800700C1 seems to be wrong. The high word 0x8007 indicates that it is a normal Windows error code. But 0xC1 / 193 is ERROR_BAD_EXE_FORMAT: '%1 is not a valid Win32 application' which makes no sense here.