Views User Guides > Foundation > The Display System > Connecting to the Display Server
Connecting to the Display Server
To initialize a Views session, you have to create an instance of the IlvDisplay class. This involves:
Opening a Connection and Checking the Display
The member function isBad returns a Boolean value that tells you whether the IlvDisplay object has been successfully created. The reasons for a display failure vary from one display system to another. For an example of this, refer to Example: Add a Directory to the Display Path.
For more information about Views error messages, see Appendix E, Error Messages.
Closing a Connection and Ending a Session
To close a connection to the display server, just destroy the IlvDisplay object. The destructor, IlvDisplay::~IlvDisplay, immediately frees all graphic resources used by the display.
If the IlvDisplay was created on the basis of an existing link to a display system, delete does not destroy this link. Except in the rare cases of multidisplay applications, destroying the IlvDisplay means the end of the session, since you cannot do much without a display.
You must call functions::IlvExit to end the session properly. It frees memory allocated by Views. This is especially important with Microsoft Windows, where this memory is not automatically freed by the system.
delete display;
IlvExit(0);
Published date: 05/24/2022
Last modified date: 02/24/2022