Subj : Re: problem including a logo in a print program To : borland.public.cpp.borlandcpp From : Ed Mulroy [TeamB] Date : Mon May 02 2005 08:43 am It has been a long time since I wrote an OWL program so there is opportunity for error in my comments. Save a copy of your original when you try them. You have an instance of TApp, a class inheriting from TApplication, declared as a global variable. As I recall that instance should be declared not as global but inside of OwlMain. The TApp::InitMainWindow function ends with exit(1). OWL programs should never be ended with a call to exit. Such a call bypasses the orderly destruction of the various class instances and can cause resource leaks and occasionally can cause abnormal program termination. OwlMain has exit(1) as the target statement to be executed if an 'if' statement condition is true. Again that is a problem, and a puzzling one since 'return 1;' in that function would do the same but in a manner which is compatible with the class destructors. If the exit(1) in OwlMain is not called then a return statement is called prior to an fclose statement. I would have expected the compiler to generate a warning about this. The fclose statement will never be executed. That also means the file will not be closed in an orderly fashion. It 'probably' will be closed by the operating system but you run the risk of it not containing some of the output, the part that was buffered by the FILE* style I/O system. 'TImage dib' is declared globally and a 'TRect' is declared globally using calls to TImage member functions as part of calculations that specify the rectangle member variable values. This is either wrong or more likely a bad practice. There is a question order of initialization between global class instances. Consider wrapping those two into a class. It might be easiest to make them members of TApp and the TApp constructor or InitMainWindow function could define their order of construction. .. Ed > Morosh wrote in message > news:4275d0a4@newsgroups.borland.com... .