Home » Extra libraries, Code snippets, applications etc. » C++ language problems and code snippets » multiple classes include-problem
Re: multiple classes include-problem [message #14436 is a reply to message #14435] |
Tue, 26 February 2008 16:54 |
bytefield
Messages: 210 Registered: December 2007
|
Experienced Member |
|
|
mrjt wrote on Tue, 26 February 2008 17:39 | Maybe I wasn't clear enough, I believe the correct solution is:
In .h file:
#define IMAGECLASS SomeImg
#define IMAGEFILE <SomeImg/SomeImg.iml>
#include <Draw/iml_header.h>
In ONE .cpp file:
#define IMAGECLASS SomeImg
#define IMAGEFILE <SomeImg/SomeImg.iml>
#include <Draw/iml_source.h>
The way the image stuff works is that the macros create a class with functions taht return the image, so naturally it is best to have the header and source for this class in .h/.cpp files.
|
Yeah, know that but if we have more sources and still want to use same *.iml file, what we do? I cannot put all my code in 2 files (header and source).
An example:
main.h - contain the generally includes, some global functions declarations, etc.
MyApp.h - MyApp class which implement main windows (it use some images from *.iml file)
MyApp.cpp - MyApp implementation and GUI_APP_MAIN
MyDialog.h - a dialog (complex) or something
MyDialog.cpp - dialog implementation
ConfigDlg.h - ...
ConfigDlg.cpp - ...
So i need images in every class (in every source). Is there another solution or mine is not so dirty? Or perhaps others use just 2 files (*.h/*.cpp) to write an application?
I don't want 10000 lines of code or more to share the same file. Should i implement the code which use images in a single source then, and other keep separated?
cdabbd745f1234c2751ee1f932d1dd75
|
|
|
Goto Forum:
Current Time: Mon May 13 01:02:57 CEST 2024
Total time taken to generate the page: 0.02694 seconds
|