So even for specific and OS-dependent tasks such as using a particular graphical API, the benefits of the Eiffel method and of reusable Eiffel components will show up quickly. The examnple application writes the x and y position in the window where the user has clicked. Also, the user must be able to clear the window by pushing a button. Class CMyWindow inherits from CFrameWnd to create a window and a button. The method InitInstance from CWinApp must be defined to create the application's main window and show it.
Programmers still have to contend with a lot of low-level details.
This version is slightly longer than the Eiffel-WEL version which follows. Clear the window. Even for such a basic and relatively low-level application, the code examples speak for themselves. Note that even though the classes of the example merely rely on the WEL library mechanisms, they can make some good use of assertions. The library classes themselves use assertions more extensively for coherence of design, readability and safety.