All of the UI components, such a windows and buttons, are derived from a class called UIBaseControl. They're all located in UIBase.h and .cpp.
I was planning on writing each dialog in its own file to avoid clutter. For example, I wrote a separate class for a login window called DLogin (The buttons are commented out because I'm still working on them):
#include "..\\include\\Headers.h"#include "..\\include\\UIBase.h"#include "..\\include\\NetworkHandler.h" //For loginsclass DLogin{protected: UIWindow* m_Window; //UITitleBar* m_TitleBar; UILabel* m_LTitle; UILabel* m_LServerDetails; UILabel* m_LServer; UILabel* m_LServerStatus; UILabel* m_LCredentials; UILabel* m_LHandle; UILabel* m_LPassword; /*CreateAccountButton* m_BCreate; LoginButton* m_BLogin; CancelButton* m_BCancel;*/ UILabel* m_ServerStatusOut; UITextBox* m_TBServer; UITextBox* m_TBHandle; UITextBox* m_TBPassword;public: DLogin (LOGFONT Font, LPDIRECT3DDEVICE9 Device); ~DLogin (); void OnSubmit ();
Now, this class works great on its own. The window renders fine, and (when I don't have them commented out) the buttons send the login information to the server.
However, I also wrote another class called DConnect, which is meant to be displayed before the login window. This class also include UIBase.h.
Both of these dialog classes are being #include'd in UIHandler. When only one is included, the engine compiles and runs fine. The moment I include a second dialog into the UIHandler and try to compile I get spammed by error C2011, one for each class in UIBase.h.
Each error informs me that the class is being redefined. For example:
error C2011: 'UIWindow' : 'class' type redefinition
If anyone has any insight on what I've done wrong, I would appreciate the help.