A good error dialog or warning dialog gives the user the following information:
What happened (from the user's point of view)
Why it happened, in simple language that the user can relate to the current task and environment
How to fix the problem
If the information cannot be presented in four or five lines of the error dialog, consider adding a help button to the dialog and link it to a topic in the help volume for your application.
For more information on writing messages, see the Common Desktop Environment: Internationalization Programmer's Guide.